/**
 * Oman to Egypt Shopping Calculator - Premium Styling System
 * Optimized for mobile-first, RTL layout compatibility, and Light/Dark themes.
 */

/* ==========================================================================
   1. Core Layout & Variables
   ========================================================================== */
body {
    font-family: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* RTL Specific Rules */
[dir="rtl"] {
    text-align: right;
}
[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}
[dir="rtl"] .me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Custom Font Helpers */
.font-numeric {
    font-family: 'Inter', system-ui, sans-serif;
}
.font-brand {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

/* ==========================================================================
   2. Design Aesthetics & Components
   ========================================================================== */

/* Main Brand Color Classes */
.bg-brand-primary {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}
.bg-brand-secondary {
    background-color: var(--secondary-color) !important;
    color: #ffffff !important;
}
.text-brand-primary {
    color: var(--primary-color) !important;
}
.text-brand-secondary {
    color: var(--secondary-color) !important;
}

/* Premium Glassmorphism & Shadow Cards */
.card-premium {
    background: var(--bs-card-bg);
    border: 1px solid rgba(var(--primary-rgb), 0.125);
    border-radius: 20px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-premium:hover {
    box-shadow: 0 15px 35px -5px rgba(var(--primary-rgb), 0.08);
}

.card-stat {
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, rgba(var(--secondary-rgb), 0.05) 100%);
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}
[dir="rtl"] .card-stat {
    border-left: none;
    border-right: 5px solid var(--primary-color);
}

/* Result Card Highlight */
.card-result {
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(var(--primary-rgb), 0.8) 100%);
    color: #ffffff;
    border: none;
    border-radius: 24px;
    box-shadow: 0 15px 35px -5px rgba(var(--primary-rgb), 0.3);
    position: relative;
    overflow: hidden;
}
.card-result::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

/* Calculator Inputs & Layout */
.input-premium {
    border-radius: 12px;
    border: 1.5px solid var(--bs-border-color);
    padding: 0.6rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}
.input-premium:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-rgb), 0.2);
}

.btn-brand-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    border-radius: 12px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-brand-primary:hover, 
.btn-brand-primary:focus,
.btn-brand-primary:active {
    background-color: rgba(var(--primary-rgb), 0.9) !important;
    border-color: rgba(var(--primary-rgb), 0.9) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.btn-brand-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 12px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-brand-outline:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* Custom Calculator Rows Transitions */
.calc-row-item {
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   3. Floating Buttons & Special Components
   ========================================================================== */

/* Floating WhatsApp Widget */
.floating-wa-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    background-color: #25d366;
    color: #ffffff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
}
.floating-wa-btn:hover {
    transform: scale(1.1) rotate(8deg);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}
[dir="rtl"] .floating-wa-btn {
    right: auto;
    left: 30px;
}

/* Header & Logo styling */
.brand-logo-img {
    max-height: 50px;
    object-fit: contain;
}

/* Print specific formatting */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    .no-print {
        display: none !important;
    }
    .card-premium, .card-result {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    .card-result .text-white {
        color: #000000 !important;
    }
}
