/* ========================================
   KAHRAMANA BAGHDAD - LUXURY UI/UX
   Production-Grade Styling
   ======================================== */

/* ==================== ENHANCED CUSTOM PROPERTIES ==================== */
:root {
    /* Colors - Luxury Dark Theme */
    --color-bg-primary: #070503;
    --color-bg-secondary: rgba(20, 13, 9, 0.78);
    --color-bg-card: rgba(25, 18, 12, 0.85);
    --color-accent-gold: #D4AF37;
    --color-accent-gold-dark: #B8941F;
    --color-accent-gold-light: #F4D03F;
    --color-text-primary: #FFFFFF;
    --color-text-secondary: rgba(255, 255, 255, 0.75);
    --color-text-muted: rgba(255, 255, 255, 0.5);
    
    /* Status Colors */
    --color-success: #4CAF50;
    --color-error: #F44336;
    --color-warning: #FF9800;
    --color-info: #2196F3;
    
    /* Gradients */
    --gradient-gold: linear-gradient(135deg, #D4AF37 0%, #F4D03F 100%);
    --gradient-gold-radial: radial-gradient(circle, #F4D03F 0%, #D4AF37 100%);
    --gradient-dark: linear-gradient(180deg, rgba(7, 5, 3, 0) 0%, rgba(7, 5, 3, 0.9) 100%);
    --gradient-overlay: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0) 100%);
    
    /* Glassmorphism */
    --glass-bg: rgba(25, 18, 12, 0.7);
    --glass-bg-strong: rgba(25, 18, 12, 0.9);
    --glass-border: rgba(212, 175, 55, 0.2);
    --glass-blur: blur(25px);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.6);
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.3);
    --shadow-gold-glow: 0 0 30px rgba(212, 175, 55, 0.4);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Z-Index Layers */
    --z-base: 1;
    --z-dropdown: 50;
    --z-nav: 100;
    --z-drawer: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-loading: 500;
}

/* ==================== ENHANCED ANIMATIONS ==================== */

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.6);
    }
}

@keyframes floatVertical {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ==================== FLOATING ACTION CART (FAC) ==================== */

.fac-pill {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: calc(var(--z-nav) + 1);
    
    display: flex;
    align-items: center;
    gap: 12px;
    
    padding: 12px 20px;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    border: 2px solid var(--glass-border);
    border-radius: 50px;
    box-shadow: var(--shadow-lg), var(--shadow-gold);
    
    cursor: pointer;
    transition: all var(--transition-normal);
    
    animation: floatVertical 3s ease-in-out infinite;
}

.fac-pill:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-xl), var(--shadow-gold-glow);
    border-color: var(--color-accent-gold);
}

.fac-pill:active {
    transform: translateY(-2px) scale(1.02);
}

.fac-icon {
    font-size: 24px;
    color: var(--color-accent-gold);
}

.fac-count {
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: var(--gradient-gold);
    color: var(--color-bg-primary);
    font-weight: 700;
    font-size: 12px;
    border-radius: 50%;
    
    animation: pulse 2s ease-in-out infinite;
}

.fac-total {
    font-weight: 700;
    font-size: 16px;
    color: var(--color-accent-gold);
}

body[dir="rtl"] .fac-pill {
    right: auto;
    left: 20px;
}

@media (min-width: 768px) {
    .fac-pill {
        bottom: 30px;
        right: 30px;
    }
    
    body[dir="rtl"] .fac-pill {
        right: auto;
        left: 30px;
    }
}

/* ==================== ENHANCED TOAST NOTIFICATIONS ==================== */

.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: var(--z-toast);
    
    display: flex;
    align-items: center;
    gap: 12px;
    
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    
    max-width: 90%;
    min-width: 200px;
    
    opacity: 0;
    transition: all var(--transition-normal);
    pointer-events: none;
}

.toast-notification.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-notification i {
    font-size: 20px;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

/* Toast Types */
.toast-success {
    border-color: rgba(76, 175, 80, 0.5);
}

.toast-success i {
    color: var(--color-success);
}

.toast-error {
    border-color: rgba(244, 67, 54, 0.5);
}

.toast-error i {
    color: var(--color-error);
}

.toast-warning {
    border-color: rgba(255, 152, 0, 0.5);
}

.toast-warning i {
    color: var(--color-warning);
}

.toast-info {
    border-color: var(--glass-border);
}

.toast-info i {
    color: var(--color-accent-gold);
}

@media (min-width: 768px) {
    .toast-notification {
        bottom: 30px;
    }
}

/* ==================== ENHANCED CART ITEMS ==================== */

.cart-item {
    padding: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 16px;
    
    transition: all var(--transition-fast);
    animation: fadeUp 0.3s ease-out backwards;
}

.cart-item:hover {
    background: rgba(35, 25, 15, 0.8);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cart-item:nth-child(1) { animation-delay: 0.05s; }
.cart-item:nth-child(2) { animation-delay: 0.1s; }
.cart-item:nth-child(3) { animation-delay: 0.15s; }
.cart-item:nth-child(4) { animation-delay: 0.2s; }
.cart-item:nth-child(5) { animation-delay: 0.25s; }

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.cart-item-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.cart-item-option {
    font-size: 14px;
    color: var(--color-text-muted);
}

.cart-item-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 8px;
    color: var(--color-error);
    
    transition: all var(--transition-fast);
}

.cart-item-remove:hover {
    background: rgba(244, 67, 54, 0.2);
    transform: scale(1.1);
}

.cart-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    
    background: rgba(40, 30, 20, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--color-text-primary);
    
    transition: all var(--transition-fast);
}

.quantity-btn:hover {
    background: var(--color-accent-gold);
    color: var(--color-bg-primary);
    transform: scale(1.1);
}

.quantity-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.cart-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.price-label {
    font-size: 13px;
    color: var(--color-text-muted);
}

.price-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-accent-gold);
}

.notes-input {
    width: 100%;
    padding: 12px;
    background: rgba(40, 30, 20, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    
    transition: all var(--transition-fast);
}

.notes-input:focus {
    outline: none;
    border-color: var(--color-accent-gold);
    background: rgba(50, 40, 30, 0.6);
}

.notes-input::placeholder {
    color: var(--color-text-muted);
}

/* ==================== ENHANCED EMPTY STATE ==================== */

.cart-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--color-text-muted);
}

.cart-empty::before {
    content: '🛒';
    display: block;
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ==================== WHATSAPP PREVIEW ENHANCEMENTS ==================== */

.whatsapp-preview-box {
    margin-top: 20px;
    background: rgba(37, 211, 102, 0.05);
    border: 2px solid rgba(37, 211, 102, 0.2);
    border-radius: 16px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(37, 211, 102, 0.1);
    border-bottom: 1px solid rgba(37, 211, 102, 0.2);
}

.preview-header i {
    font-size: 24px;
    color: #25D366;
}

.preview-message {
    padding: 20px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
}

/* ==================== LOADING STATES ==================== */

.loading-skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.loading-card {
    width: 100%;
    height: 200px;
}

.loading-text {
    width: 80%;
    height: 20px;
    margin-bottom: 10px;
}

/* ==================== IMPROVED BUTTONS ==================== */

.btn-primary,
.btn-secondary,
.btn-icon {
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before,
.btn-secondary:active::before {
    width: 300px;
    height: 300px;
}

/* ==================== ENHANCED GOLD TEXT ==================== */

.gold-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== SCROLL ENHANCEMENTS ==================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-gold);
}
