/* -------------------------------------------------------------------------- */
/* --- COLOR VARIABLES --- */
/* -------------------------------------------------------------------------- */
:root {
    /* Base Colors - Dark Mode Default */
    --white: #ffffff;
    --black: #000000;
    --bgColor: #0d0d19; /* Primary background color (Darker) */
    --secondColor: #121222; /* Secondary background color (Darkest - used for cards/sections) */
    --textColor: var(--white);
    --cardTextColor: #ccc;
    --inputBg: #333; /* Dark mode input background */
    --inputTextColor: var(--white);
    --ringColor: rgba(255, 255, 255, 0.2); /* Shadow color for dark mode elements */
    
    /* Accent Color (Remains constant for brand consistency) */
    --green: #4caf50; /* Accent color */
    --accent-dark: #388e3c; /* Darker shade of green for hover */

    /* Light Mode Variables */
    --light-bgColor: #f0f4f8; /* Light primary background */
    --light-secondColor: #ffffff; /* Light card/secondary background */
    --light-textColor: #1f2937; /* Dark text on light background */
    --light-cardTextColor: #4b5563; 
    --light-inputBg: #e5e7eb; /* Light mode input background */
    --light-inputTextColor: #1f2937;
    --light-ringColor: rgba(0, 0, 0, 0.1);
    
    --width: min(95%, 1400px);
}

/* -------------------------------------------------------------------------- */
/* --- LIGHT MODE THEME SWITCH --- */
/* -------------------------------------------------------------------------- */
.light-mode {
    --bgColor: var(--light-bgColor);
    --secondColor: var(--light-secondColor);
    --textColor: var(--light-textColor);
    --cardTextColor: var(--light-cardTextColor);
    --inputBg: var(--light-inputBg);
    --inputTextColor: var(--light-inputTextColor);
    --ringColor: var(--light-ringColor);

    /* Text colors fix for elements that need to remain dark/black */
    .text-white { /* Override specific white text elements to be dark in light mode */
        color: var(--light-textColor) !important;
    }
}

/* -------------------------------------------------------------------------- */
/* --- GENERAL STYLES & TAILWIND CUSTOM CLASSES --- */
/* -------------------------------------------------------------------------- */

.bg-primary { background-color: var(--bgColor); }
.bg-secondary { background-color: var(--secondColor); }
.text-accent { color: var(--green); }
.bg-accent { background-color: var(--green); }
.hover\:bg-accent-dark:hover { background-color: var(--accent-dark); } 

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bgColor); 
    color: var(--textColor); 
    transition: background-color 0.3s, color 0.3s;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bgColor);
}

::-webkit-scrollbar-thumb {
    background: var(--green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark);
}

/* Links and Buttons */
.interactive-link {
    color: var(--green);
    transition: transform 0.2s ease-in-out;
}
.interactive-link:hover {
    transform: translateY(-2px);
}
.download-button:hover {
    background-color: var(--accent-dark);
    transform: translateY(0);
}

/* -------------------------------------------------------------------------- */
/* --- HEADER AND SEARCH STYLES --- */
/* -------------------------------------------------------------------------- */

#main-header, #mobile-footer {
    background-color: var(--secondColor);
}

header .logo-container {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 8px 2px var(--ringColor); /* Dynamic shadow */
    transition: box-shadow 0.3s ease-in-out;
}

header .logo-container:hover {
    box-shadow: 0 0 15px 5px rgba(76, 175, 80, 0.5); /* Green shadow on hover */
}

/* Dynamic search input styling */
#desktop-search-input, #mobile-search-input {
    background-color: var(--inputBg);
    color: var(--inputTextColor);
}
.light-mode #desktop-search-input, 
.light-mode #mobile-search-input {
    color: var(--light-textColor);
}

/* -------------------------------------------------------------------------- */
/* --- CARD STYLES --- */
/* -------------------------------------------------------------------------- */

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(354px, 1fr));
    gap: 20px;
    margin: 40px auto;
    padding-inline: 10px;
    width: 100%;
}

.app-card {
    background: var(--secondColor); 
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: var(--textColor); 
    height: 105px;
    transition: all 0.5s ease-in-out;
    cursor: pointer;
    box-shadow: 0 0 0 0 transparent;
}
.app-card:hover {
    box-shadow: 0 0 15px -6px rgba(76, 175, 80, 0.5);
}

/* Image container */
.card-figure {
    width: 80px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    scale: 1;
    transition: all 0.5s ease-in;
    cursor: pointer;
}

.card-image:hover {
    transform: scale(1.2);
}

.card-middle {
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    gap: 5px;
    flex: 1;
    margin-left: 10px;
    min-width: 0;
}
.card-middle h3{
    font-size: clamp(14.4px,1vw, 25px);
}
.card-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: clamp(12px, 1vw, 14px);
    text-transform: capitalize;
    color: var(--cardTextColor); /* Dynamic detail text color */
}

/* Specific icons colors remain constant (star, platforms) */
.card-details .fa-star { color: yellow; }
.card-details .fa-android { color: #3ddc84; }
.card-details .fa-apple { color: #007aff; }

.card-download-icon {
    color: var(--textColor); /* Dynamic color for initial state */
    cursor: pointer;
    font-size: clamp(18px, 2vw, 35px);
    transition: color 0.5s ease-in;
}

.app-card:hover .card-download-icon {
    color: #007aff; 
}

/* Responsive adjustments */
@media (max-width: 470px) {
    .grid-cards {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px auto;
    }

    .app-card {
        height: auto;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px;
        gap: 15px;
    }

    .card-middle {
        align-items: center;
        margin-left: 0;
        gap: 5px;
        min-width: unset;
    }
}
/* -------------------------------------------------------------------------- */

/* Slider specific styles */
.slider-image {
    transition: opacity 0.5s ease-in-out;
}

.slider-dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
}
.slider-dot.active-dot {
    background-color: var(--white);
    transform: scale(1.2);
}

/* -------------------------------------------------------------------------- */
/* --- THEME SWITCHER BUTTON --- */
/* -------------------------------------------------------------------------- */

.theme-switcher {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 99;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--secondColor);
    color: var(--textColor);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.theme-switcher i {
    font-size: 20px;
}

@media (max-width: 768px) {
    .theme-switcher {
        bottom: 80px; 
    }
}


/* -------------------------------------------------------------------------- */
/* --- DOWNLOAD MODAL LOCKER STYLES --- */
/* -------------------------------------------------------------------------- */

/* Styling dyal L'Instructions f'Locker */
.locker-instructions .number-circle {
    /* Had Ddwwira L'Burtuqaliya Dyawl L'Arqam */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-color: #ff9900; /* L'Loun L'Burtuqali */
    color: #1a1a1a; /* L'K7al Ghameq (Katban mziana foq L'Burtuqali, Dark Mode w Light Mode) */
    font-weight: 700;
    font-size: 0.9em;
    flex-shrink: 0; /* Bash matisgharsh f'L'Responsive */
}

/* L'MUHIM: L'Kétaba Li 7da L'Arqam */
.locker-instructions li span:last-child {
    /* Ghankhaliw hadi ta5od l'color dyal l'text l'3adi f'l'modal */
    color: var(--textColor); /* Li katbdel m3a l'theme (White f'Dark, Dark f'Light) */
    text-align: left;
    padding-left: 5px; /* Massafa sghira 3la l'ddwwira */
    font-size: 0.9em;
}

body.modal-open {
    overflow: hidden!important;
}

.testimonial{
    width: 95%;
    margin: 0 auto;
}