/* 
   Core Stylesheet - Ala-Kam-like Marketplace
   Modern Design System with custom color definitions and responsive layout.
*/

:root {
    --primary-color: #1073c0;
    --text-color: #ffffff;
    --text-muted: #94a3b8;
    --bg-color: #252534;
    --card-bg: #1e1d2c;
    --border-color: #2b2a3d;
    --success-color: #1fb984;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #38bdf8;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
    --transition: all 0.2s ease-in-out;
    --font-family: 'Cairo', system-ui, -apple-system, sans-serif;
}

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

/* Local free wristwatch icon. Use it as: fa-solid fa-watch */
.fa-watch::before {
    content: "" !important;
    display: inline-block;
    width: 0.82em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 80'%3E%3Cpath d='M22 0h20l4 14c8 5 13 15 13 26S54 61 46 66l-4 14H22l-4-14C10 61 5 51 5 40s5-21 13-26L22 0Zm10 17C19.3 17 9 27.3 9 40s10.3 23 23 23 23-10.3 23-23-10.3-23-23-23Zm2 7v14.8l10 6-3 5-13-8V24h6Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 80'%3E%3Cpath d='M22 0h20l4 14c8 5 13 15 13 26S54 61 46 66l-4 14H22l-4-14C10 61 5 51 5 40s5-21 13-26L22 0Zm10 17C19.3 17 9 27.3 9 40s10.3 23 23 23 23-10.3 23-23-10.3-23-23-23Zm2 7v14.8l10 6-3 5-13-8V24h6Z'/%3E%3C/svg%3E") center / contain no-repeat;
    vertical-align: -0.1em;
}

/* Grid & Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo-area .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.logo-area .logo:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

.logo-area .logo-img {
    max-height: 44px;
    width: auto;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.06));
    transition: transform var(--transition-fast);
}

.logo-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.25);
    flex-shrink: 0;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

@media (max-width: 576px) {
    .logo-area .logo-img {
        max-height: 36px;
    }
    .logo-icon-badge {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
        border-radius: 10px;
    }
    .logo-title {
        font-size: 1.1rem;
    }
    .logo-subtitle {
        font-size: 0.62rem;
    }
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 15px;
    list-style: none;
}

.nav-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.nav-list a:hover {
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--primary-color);
}

/* Badges */
.nav-link-badge {
    position: relative;
}

.badge {
    background-color: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 50px;
    font-weight: bold;
}

.badge-danger {
    background-color: var(--danger-color);
}

/* Navigation User */
.nav-user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-avatar-icon {
    font-size: 1.8rem;
    color: var(--text-muted);
}

/* Mobile Toggle */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 30px 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-primary:hover {
    opacity: 0.9;
}

.btn-outline {
    border-color: var(--border-color);
    background-color: transparent;
}
.btn-outline:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.btn-success {
    background-color: var(--success-color);
    color: #fff;
}
.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}
.btn-danger:hover {
    opacity: 0.9;
}

/* Forms */
.auth-container {
    max-width: 480px;
    margin: 40px auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 35px;
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.auth-header p {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-color);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input {
    width: 16px;
    height: 16px;
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-danger {
    background-color: #ffebee;
    color: var(--danger-color);
    border: 1px solid #ffcdd2;
}

.alert-success {
    background-color: #e8f5e9;
    color: var(--success-color);
    border: 1px solid #c8e6c9;
}

.alert-warning {
    background-color: #fff3e0;
    color: var(--warning-color);
    border: 1px solid #ffe0b2;
}

/* Footer */
.main-footer {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 40px 0 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 15px;
    font-weight: 700;
}

.footer-section p {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: rgba(255,255,255,0.7);
}

.footer-section ul li a:hover {
    color: #fff;
    padding-right: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
}

.social-links a:hover {
    background-color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        position: relative;
    }
    
    .mobile-nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        right: 0;
        left: 0;
        background-color: var(--card-bg);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow);
        padding: 20px;
    }

    .nav-menu.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/* Mobile Bottom Navigation Bar Styling */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1050;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    gap: 4px;
    flex: 1;
    height: 100%;
    transition: var(--transition);
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.2rem;
}

.mobile-bottom-nav .nav-item:hover,
.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.mobile-bottom-nav .add-ad-nav-item i {
    color: var(--primary-color) !important;
    font-size: 1.5rem !important;
}

/* ==========================================================================
   Mobile-First Layout Redesign System
   ========================================================================== */

/* Base Layout Modifications */
.main-content {
    padding: 15px 0 80px 0; /* Add bottom padding to prevent bottom navigation overlaps on mobile */
}

/* Header Compact Controls */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}
.header-container {
    padding: 0 15px;
    height: 60px;
}
.mobile-nav-toggle {
    display: none !important; /* Hide old navigation toggle */
}

/* Mobile Quick Shortcuts in Header */
.header-shortcuts {
    display: flex;
    align-items: center;
    gap: 15px;
}
.header-shortcuts a {
    color: var(--text-color);
    font-size: 1.25rem;
    position: relative;
}
.header-shortcuts .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    font-size: 0.65rem;
    padding: 2px 5px;
}

/* Search Hero & Filter Trigger */
.search-hero {
    padding: 30px 15px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
}
.search-box-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}
.search-box-wrapper input {
    height: 48px;
    padding: 12px 20px 12px 45px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    width: 100%;
}
.search-box-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.mobile-filter-bar {
    display: flex;
    justify-content: center;
    padding: 10px 15px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}
.mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    width: 100%;
    max-width: 400px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Full-screen bottom-sheet Modal for filters on Mobile */
.filter-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    justify-content: flex-end;
    flex-direction: column;
}
.filter-sheet.active {
    display: flex;
}
.filter-sheet-content {
    background: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 25px 20px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.filter-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.filter-sheet-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}
.filter-sheet-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
}

/* Stacked Ads List Container & Large Vertical Cards */
.ads-layout {
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 20px;
}
.ads-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column stack on Mobile */
    gap: 20px;
}

.ad-card-mobile {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition);
}
.ad-card-mobile .card-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    background: #f7fafc;
}
.ad-card-mobile .card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ad-card-mobile .card-body {
    padding: 15px;
}
.ad-card-mobile .card-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 5px;
}
.ad-card-mobile .card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}
.ad-card-mobile .card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
    margin-top: 10px;
}
.ad-card-mobile .card-seller {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ad-card-mobile .card-fav-btn {
    position: absolute;
    bottom: 55px;
    left: 15px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    z-index: 10;
}

/* Ad Details Page styling (ad.php) */
.ad-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.ad-gallery-mobile {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    background: #fafafa;
    border-bottom: 1px solid var(--border-color);
}
.ad-gallery-mobile .gallery-item {
    scroll-snap-align: start;
    flex: 0 0 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-gallery-mobile .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-detail-content {
    padding: 15px;
    background: white;
}
.ad-detail-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Sticky Contact Actions Footer for Mobile viewport */
.sticky-contact-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -3px 15px rgba(0,0,0,0.08);
    display: flex;
    padding: 10px 15px;
    gap: 10px;
    z-index: 1001;
}
.sticky-contact-footer a,
.sticky-contact-footer button {
    flex: 1;
    height: 50px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    gap: 8px;
    font-size: 0.95rem;
}

/* General touch target optimizations for Mobile keyboards and forms */
.form-control {
    height: 48px !important;
    font-size: 16px !important; /* Forces mobile browsers to not auto-zoom input focus */
}
.btn {
    min-height: 44px;
    padding: 10px 20px;
}

/* Desktop Adaptive Scaling Adjustments */
@media (min-width: 768px) {
    .main-content {
        padding: 30px 0;
    }
    .mobile-filter-bar {
        display: none !important;
    }
    .filter-sheet {
        position: static !important;
        background: transparent !important;
        display: block !important;
        z-index: auto !important;
    }
    .filter-sheet-content {
        background: white !important;
        border-radius: var(--radius) !important;
        padding: 20px !important;
        max-height: none !important;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
    }
    .filter-sheet-header {
        display: none !important;
    }
    
    .ads-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 30px;
        padding: 0;
    }
    .ads-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .ad-detail-layout {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 30px;
    }
    .ad-gallery-mobile .gallery-item {
        height: 450px;
    }
    .sticky-contact-footer {
        position: static !important;
        box-shadow: none !important;
        border-top: none !important;
        padding: 0 !important;
        height: auto !important;
        flex-direction: column !important;
    }
    .sticky-contact-footer a {
        width: 100%;
    }
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* User Dashboard Ad Cards (my-ads.php) */
.user-ad-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 15px;
    display: flex;
    flex-direction: column; /* Stacked by default on Mobile */
    gap: 15px;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.user-ad-card-img {
    height: 140px;
    width: 100%;
    background: #fafafa;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}
.user-ad-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 768px) {
    .user-ad-card {
        flex-direction: row; /* Side by side on Desktop */
    }
    .user-ad-card-img {
        width: 160px;
        height: 120px;
        flex-shrink: 0;
    }
}

/* ==========================================================================
   Phase 2: Global UI/UX Skeleton Loaders, Micro-Animations & Empty States
   ========================================================================== */

/* Skeleton Loading Component */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite ease-in-out;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.skeleton-img {
    height: 160px;
    width: 100%;
}
.skeleton-text {
    height: 16px;
    width: 80%;
}
.skeleton-text-sm {
    height: 12px;
    width: 50%;
}

/* Card Hover Micro-Animations */
.ad-card-enhanced {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.ad-card-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Reusable Empty State Component */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
    margin: 20px 0;
}
.empty-state-icon {
    font-size: 3.2rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 15px;
}
.empty-state-title {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 8px;
}
.empty-state-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto 20px;
}

/* ======================================================================
   Material Design 3 marketplace refresh
   These rules intentionally sit last: pages retain their PHP markup and
   behaviour while sharing one polished, responsive visual language.
   ====================================================================== */
:root {
    --md-primary: var(--primary-color);
    --md-on-primary: #ffffff;
    --md-primary-container: color-mix(in srgb, var(--primary-color) 13%, white);
    --md-on-primary-container: #083d37;
    --md-surface: #ffffff;
    --md-surface-container: #f7f7fa;
    --md-surface-container-high: #eeeeF3;
    --md-outline: #d9dce3;
    --md-on-surface: #1a1c20;
    --md-on-surface-variant: #5d626d;
    --md-radius-xs: 12px;
    --md-radius-sm: 16px;
    --md-radius-md: 22px;
    --md-radius-lg: 30px;
    --md-elevation-1: 0 1px 2px rgba(25, 28, 32, .06), 0 2px 8px rgba(25, 28, 32, .05);
    --md-elevation-2: 0 8px 24px rgba(25, 28, 32, .10), 0 2px 5px rgba(25, 28, 32, .05);
    --radius: var(--md-radius-sm);
    --radius-sm: var(--md-radius-xs);
    --bg-color: #f8f8fb;
    --card-bg: var(--md-surface);
    --border-color: var(--md-outline);
    --text-color: var(--md-on-surface);
    --text-muted: var(--md-on-surface-variant);
    --shadow-sm: var(--md-elevation-1);
    --shadow: var(--md-elevation-2);
}

body.marketplace-app { background: var(--bg-color); letter-spacing: -.1px; }
.container { max-width: 1280px; padding-inline: 24px; }
.main-content { padding-top: 24px; }

/* Top app bar */
.marketplace-topbar { min-height: 76px; background: rgba(255,255,255,.92); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(217,220,227,.85); box-shadow: none; }
.header-container { min-height: 76px; height: auto; gap: 24px; }
.marketplace-brand .logo { gap: 11px; }
.logo-icon-badge { width: 46px; height: 46px; border-radius: 15px; background: linear-gradient(145deg, var(--primary-color), #11796f); box-shadow: 0 8px 18px color-mix(in srgb, var(--primary-color) 25%, transparent); }
.logo-title { font-size: 1.08rem; color: var(--md-on-surface); }
.logo-subtitle { color: var(--md-on-surface-variant); letter-spacing: 0; }
.marketplace-navigation { margin-inline-start: auto; }
.nav-list { gap: 4px; align-items: center; }
.nav-list > li > a:not(.btn) { border-radius: 999px; padding: 10px 13px; color: var(--md-on-surface-variant); font-weight: 700; }
.nav-list > li > a:not(.btn):hover { color: var(--primary-color); background: var(--md-primary-container); }
.marketplace-quick-actions { gap: 6px; }
.marketplace-quick-actions a { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; background: #f4f5f7; color: var(--md-on-surface-variant); }
.marketplace-quick-actions a:hover { background: var(--md-primary-container); color: var(--primary-color); }
.nav-user-profile { padding: 5px 10px !important; background: #f4f5f7; }
.nav-avatar { width: 30px; height: 30px; }

/* Material controls */
.btn { min-height: 42px; border-radius: 999px; padding: 9px 18px; font-weight: 800; box-shadow: none; }
.btn-primary, .btn-success { background: var(--primary-color); color: var(--md-on-primary); box-shadow: 0 2px 5px color-mix(in srgb, var(--primary-color) 26%, transparent); }
.btn-primary:hover, .btn-success:hover { opacity: 1; filter: brightness(.94); transform: translateY(-1px); }
.btn-outline { border-color: var(--md-outline); background: var(--md-surface); color: var(--md-on-surface); }
.btn-outline:hover { background: var(--md-surface-container-high); }
.form-control { min-height: 48px; height: 48px !important; padding: 11px 15px; border: 1px solid #747780; border-radius: 12px; background: #fff; color: var(--md-on-surface); }
.form-control:hover { border-color: var(--md-on-surface); }
.form-control:focus { border: 2px solid var(--primary-color); box-shadow: 0 0 0 3px var(--md-primary-container); }
.form-group label { color: #383b42; font-weight: 800; }
.alert { border-radius: var(--md-radius-sm); box-shadow: var(--md-elevation-1); }

/* Marketplace home */
.marketplace-hero { position: relative; overflow: hidden; padding-block: 42px 35px !important; background: radial-gradient(circle at 12% 5%, rgba(255,255,255,.2), transparent 29%), linear-gradient(120deg, #123b3e, var(--secondary-color) 46%, var(--primary-color)) !important; border: 0 !important; }
.marketplace-hero::after { content: ''; position: absolute; inset: auto -8% -70% auto; width: 480px; height: 480px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.05), 0 0 0 110px rgba(255,255,255,.04); }
.marketplace-hero .container { position: relative; z-index: 1; }
.marketplace-hero h1 { font-size: clamp(1.5rem, 3vw, 2.15rem) !important; }
.category-rail-section { background: transparent !important; border: 0 !important; padding-block: 22px !important; }
.category-rail-section .container { gap: 16px !important; padding-bottom: 4px !important; }
.category-rail-section a > div { width: 64px !important; height: 64px !important; border-radius: 22px !important; box-shadow: var(--md-elevation-1) !important; }
.marketplace-feed { padding-top: 14px !important; }
.marketplace-feed > .container > div:first-child { border-radius: var(--md-radius-md) !important; padding: 18px 20px !important; box-shadow: var(--md-elevation-1); }
.marketplace-card-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important; gap: 20px !important; }
.marketplace-listing-card, .ad-card-enhanced { border: 0 !important; border-radius: var(--md-radius-md) !important; box-shadow: var(--md-elevation-1); background: var(--md-surface) !important; }
.marketplace-listing-card:hover, .ad-card-enhanced:hover { box-shadow: var(--md-elevation-2); transform: translateY(-4px); }
.marketplace-listing-card > div:first-child { height: 200px !important; }
.marketplace-listing-card img { transition: transform .4s ease; }
.marketplace-listing-card:hover img { transform: scale(1.04); }
.marketplace-listing-card span { border-radius: 999px !important; }

/* Shared content surfaces: details, profile, forms, lists and static pages */
.auth-container { border: 0; border-radius: var(--md-radius-lg); padding: 36px; box-shadow: var(--md-elevation-2); background: var(--md-surface); }
.auth-header h2 { color: var(--md-on-surface); }
.ad-detail-content, .user-ad-card, .notification-card, .ad-card, .preview-card { border-radius: var(--md-radius-md) !important; box-shadow: var(--md-elevation-1) !important; }
.ad-detail-content { border: 0 !important; background: var(--md-surface); }
.ad-gallery-mobile { border-radius: var(--md-radius-md) var(--md-radius-md) 0 0; overflow: hidden; }
.sticky-contact-footer { border-radius: var(--md-radius-md); }
.user-ad-card { border: 0; padding: 18px; }
.empty-state { border: 1px dashed var(--md-outline); border-radius: var(--md-radius-md); background: var(--md-surface); }

/* Footer and mobile navigation */
.marketplace-footer { margin-top: 32px; padding-top: 48px; background: #152b35; }
.footer-section h3, .footer-section h4 { color: #fff; }
.social-links a { border-radius: 12px; background: rgba(255,255,255,.1); }
.mobile-bottom-nav { height: 70px; border: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -6px 22px rgba(20,28,35,.12); }
.mobile-bottom-nav .add-ad-nav-item { transform: translateY(-10px); background: var(--primary-color); color: #fff !important; border: 4px solid var(--bg-color); border-radius: 50%; width: 56px; height: 56px; flex: 0 0 56px; box-shadow: 0 5px 13px color-mix(in srgb, var(--primary-color) 32%, transparent); }
.mobile-bottom-nav .add-ad-nav-item i { color: #fff !important; }

@media (max-width: 920px) {
    .header-container { min-height: 64px; }
    .marketplace-navigation { display: none; }
    .marketplace-topbar { min-height: 64px; }
    .container { padding-inline: 16px; }
}
@media (max-width: 767px) {
    .main-content { padding-top: 12px; }
    .marketplace-hero { padding-block: 30px 26px !important; }
    .marketplace-feed > .container > div:first-child { padding: 14px !important; }
    .marketplace-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
    .marketplace-listing-card > div:first-child { height: 138px !important; }
    .marketplace-listing-card > div:last-child { padding: 11px !important; }
    .marketplace-listing-card h3 { font-size: .85rem !important; }
    .auth-container { margin: 18px auto; padding: 26px 20px; border-radius: var(--md-radius-md); }
    .footer-container { padding-bottom: 14px; }
}

/* ==========================================================================
   Custom Compact Country Code Selector
   ========================================================================== */
.phone-input-group {
    display: flex;
    gap: 8px;
    direction: ltr;
    align-items: center;
}

.country-code-picker-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.country-code-btn {
    width: 90px !important;
    height: 42px;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    border-radius: 8px !important;
    outline: none;
    font-size: 0.92rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    direction: ltr;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.country-code-btn:hover,
.country-code-btn:focus,
.country-code-picker-wrap.open .country-code-btn {
    border-color: #0ea5e9 !important;
    background: #f8fafc !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.country-code-btn .code-val {
    font-family: monospace, inherit;
    letter-spacing: 0.5px;
    color: #0f172a !important;
}

.country-code-btn .caret {
    font-size: 0.72rem;
    color: #64748b;
    transition: transform 0.2s ease;
}

.country-code-picker-wrap.open .country-code-btn .caret {
    transform: rotate(180deg);
    color: #0ea5e9;
}

.country-code-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    z-index: 9999;
    width: 230px;
    max-height: 250px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    margin: 0;
    list-style: none;
    display: none;
    direction: rtl;
    text-align: right;
}

.country-code-picker-wrap.open .country-code-dropdown {
    display: block;
    animation: countryDropdownSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes countryDropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.country-code-dropdown::-webkit-scrollbar {
    width: 6px;
}
.country-code-dropdown::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.country-code-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.country-code-item {
    padding: 10px 14px;
    font-size: 0.88rem;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    user-select: none;
}

.country-code-item:hover,
.country-code-item.selected {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
    font-weight: 700;
}

.country-code-item .country-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.country-code-item .code-badge {
    direction: ltr;
    font-weight: 700;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #475569;
    margin-right: 8px;
}

.country-code-item:hover .code-badge,
.country-code-item.selected .code-badge {
    color: #0284c7;
    background: rgba(14, 165, 233, 0.18);
}

/* ==========================================================================
   Dark Mode Overrides (Dark Blue Background)
   ========================================================================== */
html.dark-ala-kam-theme .country-code-btn,
body.dark-ala-kam-theme .country-code-btn,
body:not(.light-ala-kam-theme) .country-code-btn {
    background: #141f36 !important;
    border-color: #273754 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html.dark-ala-kam-theme .country-code-btn:hover,
html.dark-ala-kam-theme .country-code-btn:focus,
html.dark-ala-kam-theme .country-code-picker-wrap.open .country-code-btn,
body.dark-ala-kam-theme .country-code-btn:hover,
body.dark-ala-kam-theme .country-code-btn:focus,
body.dark-ala-kam-theme .country-code-picker-wrap.open .country-code-btn,
body:not(.light-ala-kam-theme) .country-code-btn:hover,
body:not(.light-ala-kam-theme) .country-code-btn:focus,
body:not(.light-ala-kam-theme) .country-code-picker-wrap.open .country-code-btn {
    background: #1c2c4c !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

html.dark-ala-kam-theme .country-code-btn .code-val,
body.dark-ala-kam-theme .country-code-btn .code-val,
body:not(.light-ala-kam-theme) .country-code-btn .code-val {
    color: #ffffff !important;
}

html.dark-ala-kam-theme .country-code-btn .caret,
body.dark-ala-kam-theme .country-code-btn .caret,
body:not(.light-ala-kam-theme) .country-code-btn .caret {
    color: #94a3b8;
}

html.dark-ala-kam-theme .country-code-dropdown,
body.dark-ala-kam-theme .country-code-dropdown,
body:not(.light-ala-kam-theme) .country-code-dropdown {
    background: #131e33;
    border-color: #273754;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

html.dark-ala-kam-theme .country-code-item,
body.dark-ala-kam-theme .country-code-item,
body:not(.light-ala-kam-theme) .country-code-item {
    color: #e2e8f0;
}

html.dark-ala-kam-theme .country-code-item:hover,
html.dark-ala-kam-theme .country-code-item.selected,
body.dark-ala-kam-theme .country-code-item:hover,
body.dark-ala-kam-theme .country-code-item.selected,
body:not(.light-ala-kam-theme) .country-code-item:hover,
body:not(.light-ala-kam-theme) .country-code-item.selected {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
}

html.dark-ala-kam-theme .country-code-item .code-badge,
body.dark-ala-kam-theme .country-code-item .code-badge,
body:not(.light-ala-kam-theme) .country-code-item .code-badge {
    background: rgba(255, 255, 255, 0.09);
    color: #94a3b8;
}

html.dark-ala-kam-theme .country-code-item:hover .code-badge,
html.dark-ala-kam-theme .country-code-item.selected .code-badge,
body.dark-ala-kam-theme .country-code-item:hover .code-badge,
body.dark-ala-kam-theme .country-code-item.selected .code-badge,
/* Custom Code Box (In-place when "Other" is selected) */
.country-code-custom-box {
    width: 90px !important;
    height: 42px;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 0 8px;
    direction: ltr;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.country-code-custom-box:focus-within {
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.custom-code-input {
    width: 55px;
    height: 100%;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: monospace, inherit;
    color: #0f172a;
    direction: ltr;
    text-align: left;
    padding: 0 !important;
    box-shadow: none !important;
}

.custom-dropdown-toggle {
    background: transparent;
    border: none;
    outline: none;
    color: #64748b;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-dropdown-toggle:hover {
    color: #0ea5e9;
}

html.dark-ala-kam-theme .country-code-custom-box,
body.dark-ala-kam-theme .country-code-custom-box,
body:not(.light-ala-kam-theme) .country-code-custom-box {
    background: #141f36 !important;
    border-color: #273754 !important;
}

html.dark-ala-kam-theme .country-code-custom-box:focus-within,
body.dark-ala-kam-theme .country-code-custom-box:focus-within,
body:not(.light-ala-kam-theme) .country-code-custom-box:focus-within {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

html.dark-ala-kam-theme .custom-code-input,
body.dark-ala-kam-theme .custom-code-input,
body:not(.light-ala-kam-theme) .custom-code-input {
    color: #ffffff !important;
}

/* ==========================================================================
   Modern Profile Avatar Uploader Component
   ========================================================================== */
.profile-avatar-uploader {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: rgba(248, 250, 252, 0.8);
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    transition: all 0.25s ease;
}

html.dark-ala-kam-theme .profile-avatar-uploader,
body.dark-ala-kam-theme .profile-avatar-uploader,
body:not(.light-ala-kam-theme) .profile-avatar-uploader {
    background: rgba(20, 31, 54, 0.6);
    border-color: #273754;
}

.profile-avatar-uploader:hover {
    border-color: #0ea5e9;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.1);
}

.avatar-preview-container {
    position: relative;
    width: 82px;
    height: 82px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 50%;
}

.avatar-preview-img,
.avatar-preview-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0ea5e9;
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.2);
    transition: transform 0.2s ease, filter 0.2s ease;
    background: #ffffff;
    box-sizing: border-box;
}

html.dark-ala-kam-theme .avatar-preview-img,
html.dark-ala-kam-theme .avatar-preview-placeholder,
body.dark-ala-kam-theme .avatar-preview-img,
body.dark-ala-kam-theme .avatar-preview-placeholder,
body:not(.light-ala-kam-theme) .avatar-preview-img,
body:not(.light-ala-kam-theme) .avatar-preview-placeholder {
    background: #141f36;
    border-color: #38bdf8;
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.25);
}

.avatar-preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #0ea5e9;
}

html.dark-ala-kam-theme .avatar-preview-placeholder,
body.dark-ala-kam-theme .avatar-preview-placeholder,
body:not(.light-ala-kam-theme) .avatar-preview-placeholder {
    color: #38bdf8;
}

.avatar-preview-container:hover .avatar-preview-img,
.avatar-preview-container:hover .avatar-preview-placeholder {
    transform: scale(1.04);
    filter: brightness(0.92);
}

.avatar-camera-badge {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 28px;
    height: 28px;
    background: #0ea5e9;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, background 0.2s ease;
}

html.dark-ala-kam-theme .avatar-camera-badge,
body.dark-ala-kam-theme .avatar-camera-badge,
body:not(.light-ala-kam-theme) .avatar-camera-badge {
    background: #38bdf8;
    color: #0f172a;
    border-color: #141f36;
}

.avatar-preview-container:hover .avatar-camera-badge {
    transform: scale(1.15);
}

.avatar-upload-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.avatar-upload-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #0f172a;
}

html.dark-ala-kam-theme .avatar-upload-title,
body.dark-ala-kam-theme .avatar-upload-title,
body:not(.light-ala-kam-theme) .avatar-upload-title {
    color: #ffffff;
}

.avatar-upload-subtext {
    font-size: 0.8rem;
    color: #64748b;
}

html.dark-ala-kam-theme .avatar-upload-subtext,
body.dark-ala-kam-theme .avatar-upload-subtext,
body:not(.light-ala-kam-theme) .avatar-upload-subtext {
    color: #94a3b8;
}

.btn-choose-avatar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 8px;
    background: #0ea5e9;
    color: #ffffff;
    border: none;
    cursor: pointer;
    width: fit-content;
    transition: all 0.2s ease;
    margin-top: 6px;
}

.btn-choose-avatar:hover {
    background: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

html.dark-ala-kam-theme .btn-choose-avatar,
body.dark-ala-kam-theme .btn-choose-avatar,
body:not(.light-ala-kam-theme) .btn-choose-avatar {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Force 'تواصل' contact button text and icon to be pure white in Light & Dark Mode */
.ala-kam-contact-badge-btn,
.ala-kam-contact-badge-btn *,
.ala-kam-contact-badge-btn i,
.ala-kam-contact-badge-btn span,
a.ala-kam-contact-badge-btn,
a.ala-kam-contact-badge-btn:hover,
a.ala-kam-contact-badge-btn:visited,
a.ala-kam-contact-badge-btn:focus,
a.ala-kam-contact-badge-btn:active,
body.light-ala-kam-theme .ala-kam-contact-badge-btn,
body.light-ala-kam-theme .ala-kam-contact-badge-btn *,
body.light-ala-kam-theme .ala-kam-contact-badge-btn i,
body.light-ala-kam-theme .ala-kam-contact-badge-btn span,
html.light-ala-kam-theme .ala-kam-contact-badge-btn,
html.light-ala-kam-theme .ala-kam-contact-badge-btn *,
html.light-ala-kam-theme .ala-kam-contact-badge-btn i,
html.light-ala-kam-theme .ala-kam-contact-badge-btn span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Receipts Count Badge styling for Light & Dark mode */
.receipts-count-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 12px;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Modern Receipt File Upload Dropzone Component
   ========================================================================== */
.receipt-dropzone-container {
    margin-bottom: 20px;
}

.receipt-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 16px;
    background: rgba(248, 250, 252, 0.9);
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
}

html.dark-ala-kam-theme .receipt-dropzone,
body.dark-ala-kam-theme .receipt-dropzone,
body:not(.light-ala-kam-theme) .receipt-dropzone {
    background: rgba(20, 31, 54, 0.6);
    border-color: #273754;
}

.receipt-dropzone:hover,
.receipt-dropzone.dragover {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.05);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.12);
}

.receipt-dropzone-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.12);
    color: #0ea5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}

html.dark-ala-kam-theme .receipt-dropzone-icon,
body.dark-ala-kam-theme .receipt-dropzone-icon,
body:not(.light-ala-kam-theme) .receipt-dropzone-icon {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.receipt-dropzone:hover .receipt-dropzone-icon {
    transform: translateY(-3px) scale(1.05);
}

.receipt-dropzone-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
}

html.dark-ala-kam-theme .receipt-dropzone-title,
body.dark-ala-kam-theme .receipt-dropzone-title,
body:not(.light-ala-kam-theme) .receipt-dropzone-title {
    color: #ffffff;
}

.receipt-dropzone-subtext {
    font-size: 0.8rem;
    color: #64748b;
}

html.dark-ala-kam-theme .receipt-dropzone-subtext,
body.dark-ala-kam-theme .receipt-dropzone-subtext,
body:not(.light-ala-kam-theme) .receipt-dropzone-subtext {
    color: #94a3b8;
}

.receipt-file-tags {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.receipt-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
}

html.dark-ala-kam-theme .receipt-tag,
body.dark-ala-kam-theme .receipt-tag,
body:not(.light-ala-kam-theme) .receipt-tag {
    background: #1e293b;
    color: #38bdf8;
    border: 1px solid #334155;
}

/* Selected File Preview Box */
.receipt-preview-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

html.dark-ala-kam-theme .receipt-preview-card,
body.dark-ala-kam-theme .receipt-preview-card,
body:not(.light-ala-kam-theme) .receipt-preview-card {
    background: #141f36;
    border-color: #273754;
}

.receipt-preview-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #0ea5e9;
    flex-shrink: 0;
}

.receipt-preview-pdf-icon {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.receipt-preview-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.receipt-preview-filename {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html.dark-ala-kam-theme .receipt-preview-filename,
body.dark-ala-kam-theme .receipt-preview-filename,
body:not(.light-ala-kam-theme) .receipt-preview-filename {
    color: #ffffff;
}

.receipt-preview-filesize {
    font-size: 0.78rem;
    color: #64748b;
}

html.dark-ala-kam-theme .receipt-preview-filesize,
body.dark-ala-kam-theme .receipt-preview-filesize,
body:not(.light-ala-kam-theme) .receipt-preview-filesize {
    color: #94a3b8;
}

.btn-remove-receipt {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* ==========================================================================
   First Time Country Selector Modal Component
   ========================================================================== */
.first-time-country-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
    animation: fadeInOverlay 0.35s ease-out;
}

html.dark-ala-kam-theme .first-time-country-overlay,
body.dark-ala-kam-theme .first-time-country-overlay {
    background: rgba(15, 23, 42, 0.85);
}

.country-modal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    width: 100%;
    max-width: 580px;
    padding: 36px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
    text-align: center;
    color: #0f172a;
    transition: all 0.3s ease;
}

html.dark-ala-kam-theme .country-modal-card,
body.dark-ala-kam-theme .country-modal-card,
body:not(.light-ala-kam-theme) .country-modal-card {
    background: #141f36;
    border-color: #273754;
    color: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.country-modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #10b981;
    margin-bottom: 8px;
}

.country-modal-desc {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 28px;
}

html.dark-ala-kam-theme .country-modal-desc,
body.dark-ala-kam-theme .country-modal-desc,
body:not(.light-ala-kam-theme) .country-modal-desc {
    color: #94a3b8;
}

.country-btn-saudi {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    background: rgba(16, 185, 129, 0.07);
    border: 2px solid #10b981;
    border-radius: 16px;
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

html.dark-ala-kam-theme .country-btn-saudi,
body.dark-ala-kam-theme .country-btn-saudi,
body:not(.light-ala-kam-theme) .country-btn-saudi {
    color: #ffffff;
    background: rgba(16, 185, 129, 0.12);
}

.country-btn-saudi:hover {
    background: rgba(16, 185, 129, 0.14);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.15);
}

.country-badge-saudi {
    font-size: 0.88rem;
    background: #10b981;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 800;
}

.country-btn-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

html.dark-ala-kam-theme .country-btn-item,
body.dark-ala-kam-theme .country-btn-item,
body:not(.light-ala-kam-theme) .country-btn-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.country-btn-item:hover {
    background: #ffffff;
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}

html.dark-ala-kam-theme .country-btn-item:hover,
body.dark-ala-kam-theme .country-btn-item:hover,
body:not(.light-ala-kam-theme) .country-btn-item:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
    color: #ffffff;
}

.country-btn-badge {
    font-size: 0.78rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 8px;
}

html.dark-ala-kam-theme .country-btn-badge,
body.dark-ala-kam-theme .country-btn-badge,
body:not(.light-ala-kam-theme) .country-btn-badge {
    background: #1e293b;
    color: #94a3b8;
}

/* Country Selector Dropdown Menu in Header */
.ala-kam-dropdown-menu.country-dropdown {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

html.dark-ala-kam-theme .ala-kam-dropdown-menu.country-dropdown,
body.dark-ala-kam-theme .ala-kam-dropdown-menu.country-dropdown,
body:not(.light-ala-kam-theme) .ala-kam-dropdown-menu.country-dropdown {
    background: #141f36 !important;
    border-color: #273754 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

.ala-kam-dropdown-menu.country-dropdown a {
    color: #334155 !important;
}

html.dark-ala-kam-theme .ala-kam-dropdown-menu.country-dropdown a,
body.dark-ala-kam-theme .ala-kam-dropdown-menu.country-dropdown a,
body:not(.light-ala-kam-theme) .ala-kam-dropdown-menu.country-dropdown a {
    color: #cbd5e1 !important;
}

.ala-kam-dropdown-menu.country-dropdown a:hover {
    background: #f1f5f9 !important;
    color: #10b981 !important;
}

html.dark-ala-kam-theme .ala-kam-dropdown-menu.country-dropdown a:hover,
body.dark-ala-kam-theme .ala-kam-dropdown-menu.country-dropdown a:hover,
body:not(.light-ala-kam-theme) .ala-kam-dropdown-menu.country-dropdown a:hover {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #10b981 !important;
}









