/* ==========================================================================
   1. GLOBAL STYLES & CSS VARIABLES
   ========================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Montserrat:wght@500;700&family=Poppins:wght@300;400;500;600&display=swap');

/* Define CSS Variables for Theming */
:root {
    /* Fonts */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --font-display: 'Montserrat', sans-serif;

    /* Light Theme Colors */
    --color-bg: #f0f4f8;
    --color-bg-gradient-start: #7b4397;
    --color-bg-gradient-end: #dc2430;
    --color-text-primary: #1a202c;
    --color-text-secondary: #4a5568;
    --color-accent: #6b46c1;
    --color-accent-hover: #553c9a;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-success: #38a169;
    --color-warning: #dd6b20;
    --color-new-badge: #3182ce;
    --color-updated-badge: #dd6b20;

    /* Navbar Colors (Light) */
    --nav-color: #ffffff;
    --text-color: #333;
    --search-bar: #f2f2f2;
    --search-text: #000;
    --side-nav: #ffffff;

    /* Glassmorphism Effect Colors (Light) */
    --glass-bg: rgba(255, 255, 255, 0.3);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

    /* Spacing & Sizing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --border-radius: 12px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --color-bg: #021526;
    --color-text-primary: #edf2f7;
    --color-text-secondary: #a0aec0;
    --color-accent: #9f7aea;
    --color-accent-hover: #805ad5;
    --color-border: rgba(255, 255, 255, 0.1);

    /* Navbar Colors (Dark) */
    --nav-color: #6EACDA;
    --text-color: #ffffff;
    --search-bar: #3a3b3c;
    --search-text: #ccc;
    --side-nav: #242526;

    /* Glassmorphism Effect Colors (Dark) */
    --glass-bg: rgba(45, 55, 72, 0.5);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Typography & Links */
h1, h2, h3 {
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--color-text-primary);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: none; /* Default to no underline on hover */
    color: var(--color-accent-hover);
}

/* Specific overrides for elements that should not have underline on hover */
.logo:hover,
.footer-nav a:hover {
    text-decoration: none;
    color: var(--color-new-badge); /* Keep hover color consistent */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Accessibility: Visually hidden class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Accessibility: Focus visible state for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ==========================================================================
   2. REUSABLE COMPONENTS (Container, Buttons, Forms)
   ========================================================================== */

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    border: none;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 44px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-text-primary);
    color: var(--color-bg);
}

/* Glassmorphism Style */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}


/* ==========================================================================
   3. HEADER & NAVIGATION (New Navbar Styles)
   ========================================================================== */
/* The new navbar styles provided by the user */
nav{
    position: fixed;
    top: 0;
    left: 0;
    height: 70px;
    width: 100%;
    background-color: var(--nav-color);
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Add a subtle shadow */
}
body.dark nav{
    border-bottom: 1px solid #393838; /* Use border-bottom for dark mode */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* Darker shadow for dark mode */
}
nav .nav-bar{
    position: relative;
    height: 100%;
    max-width: 1200px; /* Increased max-width for better desktop layout */
    width: 100%;
    background-color: var(--nav-color);
    margin: 0 auto;
    padding: 0 20px; /* Adjusted padding */
    display: flex;
    align-items: center;
    justify-content: space-between;
}
nav .nav-bar .sidebarOpen{
    color: var(--text-color);
    font-size: 25px;
    padding: 5px;
    cursor: pointer;
    display: none; /* Hidden by default, shown on smaller screens */
}
nav .nav-bar .logo a{
    font-size: 17px;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}
.menu .logo-toggle{
    display: none; /* Hidden by default, shown in sidebar */
}
.nav-bar .nav-links{
    display: flex;
    align-items: center;
}
.nav-bar .nav-links li{
    margin: 0 10px; /* Adjusted margin */
    list-style: none;
}
.nav-links li a{
    position: relative;
    font-size: 17px;
    font-weight: 400;
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 0; /* Adjusted padding */
}

/* Hide dark mode toggle in desktop nav-links by default */
.nav-links .dark-light-mobile {
    display: none;
}
.nav-links li a::before{
    content: '';
    position: absolute;
    left: 0; /* Start from left */
    bottom: 0;
    height: 2px; /* Thinner underline */
    width: 0%; /* Hidden by default */
    border-radius: 0; /* No border-radius for underline */
    background-color: var(--color-accent); /* Use accent color for underline */
    opacity: 1; /* Always visible when active/hover */
    transition: all 0.3s ease;
}

/* Hide mobile nav links by default */
.mobile-nav-links {
    display: none;
}
.nav-links li:hover a::before,
.nav-links li a.active::before{ /* Added active state */
    width: 100%; /* Expand on hover/active */
}
.nav-bar .darkLight-searchBox{
    display: flex;
    align-items: center;
}
.darkLight-searchBox .dark-light,
.darkLight-searchBox .searchToggle{
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    border-radius: 50%; /* Make buttons round */
    transition: background-color 0.3s ease;
}
.darkLight-searchBox .dark-light:hover,
.darkLight-searchBox .searchToggle:hover {
    background-color: rgba(0, 0, 0, 0.05); /* Subtle hover effect */
}
body.dark .darkLight-searchBox .dark-light:hover,
body.dark .darkLight-searchBox .searchToggle:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Subtle hover effect for dark mode */
}

.dark-light i,
.searchToggle i{
    position: absolute;
    color: var(--text-color);
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.dark-light i.sun{
    opacity: 0;
    pointer-events: none;
}
body.dark .dark-light i.sun{ /* Corrected dark mode sun icon visibility */
    opacity: 1;
    pointer-events: auto;
}
body.dark .dark-light i.moon{ /* Corrected dark mode moon icon visibility */
    opacity: 0;
    pointer-events: none;
}
.searchToggle i.cancel{
    opacity: 0;
    pointer-events: none;
}
.searchToggle.active i.cancel{
    opacity: 1;
    pointer-events: auto;
}
.searchToggle.active i.search{
    opacity: 0;
    pointer-events: none;
}
.searchBox{
    position: relative;
}
.searchBox .search-field{
    position: absolute;
    bottom: -85px; /* Adjusted position */
    right: 5px;
    height: 50px;
    width: 300px;
    display: flex;
    align-items: center;
    background-color: var(--nav-color);
    padding: 3px;
    border-radius: 6px;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}
.searchToggle.active ~ .search-field{
    bottom: -74px;
    opacity: 1;
    pointer-events: auto;
}
.search-field::before{
    content: '';
    position: absolute;
    right: 14px;
    top: -4px;
    height: 12px;
    width: 12px;
    background-color: var(--nav-color);
    transform: rotate(-45deg);
    z-index: -1;
}
.search-field input{
    height: 100%;
    width: 100%;
    padding: 0 45px 0 15px;
    outline: none;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    color: var(--search-text);
    background-color: var(--search-bar);
}
.search-field i{
    position: absolute;
    color: var(--text-color); /* Changed to text-color for consistency */
    right: 15px;
    font-size: 22px;
    cursor: pointer;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 790px) {
    nav .nav-bar {
        display: flex;
        flex-direction: column; /* Stack items vertically */
        height: auto; /* Allow height to adjust */
        padding: 10px 20px; /* Add some vertical padding */
        align-items: center; /* Align items to the start */
    }

    nav .nav-bar .sidebarOpen{
        display: block;
        order: 1; /* Burger menu first */
    }
    nav .nav-bar .logo.navLogo {
        order: 2; /* App logo/name second */
        margin-top: 10px; /* Space below burger menu */
    }
    .nav-bar .darkLight-searchBox{
        position: static; /* Remove absolute positioning */
        transform: none; /* Remove transform */
        order: 3; /* Search box third */
        width: 100%; /* Take full width */
        justify-content: center; /* Center search icon */
        margin-top: 10px; /* Space below app name */
    }
    .menu{
        position: fixed;
        height: 100%;
        width: 320px;
        left: -100%;
        top: 0;
        padding: 20px;
        background-color: var(--side-nav);
        z-index: 100;
        transition: all 0.4s ease;
    }
    nav.active .menu{
        left: 0%; /* Changed to 0% to slide in from left */
    }
    nav.active .nav-bar .navLogo a{
        opacity: 0;
        transition: all 0.3s ease;
    }
    .menu .logo-toggle{
        display: flex; /* Changed to flex to show logo and close button */
        width: 100%;
        align-items: center;
        justify-content: space-between;
    }
    .logo-toggle .siderbarClose{
        color: var(--text-color);
        font-size: 24px;
        cursor: pointer;
    }
    .nav-bar .nav-links{
        display: none; /* Hide desktop nav links on mobile */
    }

    .mobile-nav-links {
        display: flex; /* Show mobile nav links in sidebar */
        flex-direction: column;
        padding-top: 30px;
    }
    .mobile-nav-links li{
        margin: 0; /* Reset margin for vertical links */
        list-style: none;
    }
    .mobile-nav-links li a,
    .mobile-nav-links .dark-light-mobile {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 20px;
        padding: 10px 0;
        color: var(--text-color);
        cursor: pointer;
        font-size: 17px;
        font-weight: 400;
        text-decoration: none; /* Ensure links are not underlined by default */
    }
    .mobile-nav-links li a::before{
        content: '';
        position: absolute;
        left: 50%; /* Center underline for vertical links */
        bottom: 0;
        height: 2px; /* Thinner underline */
        width: 0%; /* Hidden by default */
        border-radius: 0; /* No border-radius for underline */
        background-color: var(--color-accent); /* Use accent color for underline */
        opacity: 1; /* Always visible when active/hover */
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }
    .mobile-nav-links li:hover a::before,
    .mobile-nav-links li a.active::before{ /* Added active state */
        width: 100%; /* Expand on hover/active */
    }

    .mobile-nav-links .dark-light-mobile i {
        font-size: 22px;
    }

    .mobile-nav-links .dark-light-mobile i.sun {
        opacity: 0;
        pointer-events: none;
    }

    body.dark .mobile-nav-links .dark-light-mobile i.sun {
        opacity: 1;
        pointer-events: auto;
    }

    body.dark .mobile-nav-links .dark-light-mobile i.moon {
        opacity: 0;
        pointer-events: none;
    }

    /* Hide the dark-light toggle and admin button from the main navbar on mobile */
    .darkLight-searchBox .dark-light,
    .darkLight-searchBox .admin-login-btn {
        display: none;
    }

    /* Carousel full width on mobile */
    .hero-section {
        margin-top: 60px;
    }

    .hero-section .container {
        width: 100%;
        padding: 0;
    }

    .hero-section .carousel {
        border-radius: 0;
        box-shadow: none; /* Remove shadow for full-width look */
    }
}


/* ==========================================================================
   4. HERO SECTION
   ========================================================================== */
.hero-section {
    position: relative;
    padding: 6rem 0;
    text-align: center;
    overflow: hidden;
}

@keyframes gradient-animation {
    0% { transform: translate(0%, 0%) rotate(0deg); }
    25% { transform: translate(5%, 5%) rotate(10deg); }
    50% { transform: translate(0%, 0%) rotate(0deg); }
    75% { transform: translate(-5%, -5%) rotate(-10deg); }
    100% { transform: translate(0%, 0%) rotate(0deg); }
}

/* Bootstrap Carousel Customizations */
.carousel {
    border-radius: var(--border-radius); /* Apply rounded corners */
    overflow: hidden; /* Ensure content respects border-radius */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* Keep existing shadow */
}

.carousel-item img {
    height: 400px; /* Fixed height for carousel images */
    object-fit: cover; /* Ensure images cover the area */
}

@media (max-width: 790px) {
    .carousel-item img {
        height: auto; /* Make height responsive on mobile */
        width: 100%; /* Ensure image takes full width */
    }
}

/* Adjust carousel controls for better visibility */
.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1; /* Always visible */
    transition: background-color 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 24px;
    height: 24px;
    background-size: 100%, 100%;
}

.carousel-caption {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 12px 15px;
    border-radius: 0 0 var(--border-radius) var(--border-radius); /* Rounded bottom corners */
}

.carousel-caption h5 {
    font-size: 1.5rem;
    font-weight: 600;
}

.carousel-caption p {
    font-size: 1rem;
}

/* ==========================================================================
   5. APP GALLERY
   ========================================================================== */
.app-gallery-section {
    padding: var(--spacing-lg) 0;
    overflow: hidden; /* Ensure proper containment of grid items */
    margin-bottom: var(--spacing-lg); /* Add space before the next section */
    min-height: 500px; /* Ensure the section takes up enough space */
}

.gallery-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

#category-filter {
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border); /* Use glass border */
    background-color: var(--glass-bg); /* Use glass background */
    color: var(--color-text-primary);
    font-family: var(--font-secondary);
    appearance: none; /* Remove default dropdown arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23${encodeURIComponent(getComputedStyle(document.documentElement).getPropertyValue('--color-text-primary').substring(1))}'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); /* Custom arrow */
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1.2em;
    cursor: pointer;
}

.view-switcher {
    display: none; /* Hidden as per user request */
    background-color: var(--glass-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 4px;
}

.view-switcher .view-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.view-switcher .view-btn.active {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* App Grid & Cards */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Adjusted for more square cards */
    gap: var(--spacing-md);
    transition: grid-template-columns 0.4s ease;
    margin-top: var(--spacing-lg); /* Add margin to separate from controls */
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content within the card */
    justify-content: flex-start;
    padding: var(--spacing-sm);
    background-color: #fff; /* Use theme background color */
    border-radius: 16px; /* Rounded corners for the card */
    overflow: hidden; /* Ensure content respects border-radius */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* More subtle shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative; /* For badge positioning */
}

.app-card:hover, .app-card:focus-within {
    transform: translateY(-4px); /* Slightly less aggressive lift on hover */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.app-card-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs); /* Reduced gap */
    flex-grow: 1;
    width: 100%;
    text-align: center;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    flex-shrink: 0;
    margin-bottom: var(--spacing-xs);
    position: relative; /* For badge positioning relative to icon */
}

.app-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: var(--spacing-xs); /* Space between icon and text */
}

.app-name {
    font-size: 1rem; /* Slightly smaller name */
    font-weight: 500; /* Lighter font weight */
    margin-bottom: 2px; /* Reduced margin */
    color: black; /* Changed to black as per user request */
}

.app-version {
    font-size: 0.8rem; /* Smaller version text */
    color: var(--color-text-secondary);
}

.badge {
    position: absolute;
    top: 8px; /* Adjusted position for better visibility */
    right: 8px; /* Adjusted position for better visibility */
    font-size: 0.65rem; /* Smaller font size for badge */
    padding: 0.15rem 0.4rem; /* Smaller padding */
    border-radius: 4px; /* Slightly smaller border-radius */
    color: white;
    font-weight: 600;
    transform: none; /* No offset transform */
    z-index: 10; /* Ensure badge is above other elements */
}
.new-badge { background-color: #4CAF50; } /* Green for new */
.updated-badge { background-color: #FFC107; } /* Amber for updated */
.coming-soon-badge { background-color: #9C27B0; } /* Purple for coming soon */
.beta-badge { background-color: #2196F3; } /* Blue for beta */
.lite-badge { background-color: #9E9E9E; } /* Grey for lite */
.hd-badge { background-color: #F44336; } /* Red for HD */
.mini-badge { background-color: #FF9800; } /* Orange for Mini */


.app-card-footer {
    display: none; /* Hide the footer (download/favorite buttons) */
}

.rating {
    display: flex;
    align-items: center;
    gap: 2px; /* Smaller gap */
    font-size: 0.8rem; /* Smaller rating font size */
    color: var(--color-text-secondary); /* Default text color for rating */
    margin-top: 4px; /* Space above rating */
}
.rating .star {
    color: #FFC107; /* Amber color for stars */
}
.rating span {
    color: black; /* Changed to black as per user request */
    font-weight: 400; /* Lighter font weight */
    margin-left: 2px;
}

/* Responsive adjustments for smaller screens (mobile list view) */
@media (max-width: 1023px) {
    .main-nav .nav-links {
        display: none; /* Hide nav links on smaller screens */
    }

    .main-nav .search-form {
        margin-left: 0;
        width: 100%;
        order: 3; /* Move search below logo and actions */
        margin-top: var(--spacing-sm);
    }

    .search-form input {
        width: 100%;
    }

    .header-actions {
        margin-left: auto; /* Push actions to the right */
    }

    .burger-menu-btn {
        display: block; /* Show burger menu on smaller screens */
    }
}

@media (max-width: 767px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
    .app-card {
        flex-direction: column; /* Keep column layout for consistency */
        align-items: center;
        text-align: center;
    }
    .app-card-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .app-icon {
        width: 80px;
        height: 80px;
        margin-bottom: var(--spacing-xs);
        margin-right: 0;
    }
    .app-info {
        align-items: center;
    }
    .badge {
        top: 8px;
        right: 8px;
        transform: none;
    }
    .app-card-footer {
        display: none; /* Still hidden */
    }
    .rating {
        margin-bottom: 0;
    }
}

/* View Switcher Overrides (User-selected views take precedence) */
.app-grid.view-google { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } /* Adjusted for more square cards */
.app-grid.view-google .app-card { flex-direction: column; align-items: center; justify-content: flex-start; }
.app-grid.view-google .app-card-main { flex-direction: column; align-items: center; text-align: center; }
.app-grid.view-google .app-icon { width: 80px; height: 80px; margin-bottom: var(--spacing-xs); margin-right: 0; }
.app-grid.view-google .app-info { align-items: center; }
.app-grid.view-google .badge { top: 8px; right: 8px; transform: none; }
.app-grid.view-google .app-card-footer { display: none; }
.app-grid.view-google .rating { margin-bottom: 0; }


/* .app-grid.view-apple { grid-template-columns: 6fr; } */
.app-grid.view-apple .app-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}
.app-grid.view-apple .app-card-main { flex-direction: row; align-items: center; text-align: left; justify-content: flex-start;  }
.app-grid.view-apple .app-icon { width: 64px; height: 64px; margin-bottom: 0; margin-right: var(--spacing-sm); }
.app-grid.view-apple .app-info { align-items: flex-start; }
.app-grid.view-apple .badge { top: 8px; right: 8px; transform: none; }
.app-grid.view-apple .app-card-footer { display: none; }
.app-grid.view-apple .rating { margin-bottom: 0; }

.app-grid.view-qr { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.app-grid.view-qr .app-card { align-items: center; text-align: center; }
.app-grid.view-qr .app-card-main { flex-direction: column; }
.app-grid.view-qr .app-card-footer { display: none; } /* Hide footer in QR view */


/* Animation on scroll */
.app-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.app-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   6. NEWSLETTER & FOOTER
   ========================================================================== */
.newsletter-section {
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.newsletter-form {
    margin-top: var(--spacing-md);
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.newsletter-form input {
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
}

.main-footer {
    background-color: #0a192f; /* Dark blue background from image */
    color: #a0aec0; /* Light grey text color */
    padding-top: 4rem;
    font-family: var(--font-secondary);
}

.main-footer a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-footer a:hover {
    color: #edf2f7; /* Lighter text on hover */
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-about .footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #edf2f7;
    margin-bottom: 1rem;
}

.footer-about .footer-logo img {
    height: 30px;
    width: auto;
}

.footer-about p {
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-links h3,
.footer-others h3,
.footer-social h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #edf2f7;
    margin-bottom: 1.2rem;
    position: relative;
    padding-left: 15px; /* Space for the blue line */
}

.footer-links h3::before,
.footer-others h3::before,
.footer-social h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background-color: #3182ce; /* Blue line color */
    border-radius: 2px;
}

.footer-links ul,
.footer-others ul {
    list-style: none;
}

.footer-links li,
.footer-others li {
    margin-bottom: 0.8rem;
}

.footer-links a,
.footer-others a {
    font-size: 0.9rem;
}

.footer-social .social-icons {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}

.footer-social .social-icons a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background-color: #2d3748; /* Darker background for icons */
    border-radius: 8px;
    font-size: 1.1rem;
    color: #edf2f7;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.footer-social .social-icons a:hover {
    background-color: #3182ce; /* Blue hover for icons */
    color: white;
}

/* Specific social icon colors */
.footer-social .social-icons .fa-facebook-f { background-color: #3b5998; }
.footer-social .social-icons .fa-instagram { background-color: #E1306C; }
.footer-social .social-icons .fa-twitter { background-color: #1DA1F2; }
.footer-social .social-icons .fa-youtube { background-color: #FF0000; }
.footer-social .social-icons .fa-linkedin-in { background-color: #0077B5; }


.footer-bottom {
    padding: 1.5rem 0;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.footer-bottom .copyright {
    margin-bottom: 0;
}

.footer-bottom .language-selector {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.footer-bottom .language-selector:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Responsive adjustments for footer */
@media (max-width: 767px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-about {
        text-align: center;
    }
    .footer-links h3,
    .footer-others h3,
    .footer-social h3 {
        text-align: center;
        padding-left: 0; /* Remove left padding for centering */
    }
    .footer-links h3::before,
    .footer-others h3::before,
    .footer-social h3::before {
        left: 50%;
        transform: translate(-50%, -50%);
    }
    .footer-social .social-icons {
        justify-content: center;
    }
    .footer-bottom .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .footer-bottom .copyright {
        margin-bottom: 0.5rem; /* Add some space between copyright and language selector */
    }
}


/* ==========================================================================
   8. RESPONSIVE DESIGN
   ========================================================================== */

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1023px) {
    .main-header .container {
        flex-wrap: wrap;
        justify-content: center;
    }
    .main-header .logo {
        width: 100%;
        justify-content: center;
        margin-bottom: var(--spacing-sm);
    }
    .main-nav {
        order: 3; /* Move search below logo and actions */
        width: 100%;
        margin-top: var(--spacing-sm);
        justify-content: center; /* Center nav links on tablet */
    }
    .main-nav .nav-links {
        display: flex; /* Show nav links on tablet */
    }
    .search-form {
        width: 100%;
        margin-top: 0;
        margin-left: 0;
    }
    .search-form input {
        width: 100%;
    }
    .header-actions {
        width: 100%;
        justify-content: center;
        margin-top: var(--spacing-sm);
        margin-left: 0;
    }
    .burger-menu-btn {
        display: none; /* Hide burger menu on tablet */
    }
    .hero-title {
        font-size: 4rem;
    }
    .app-grid.view-google { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } /* Adjusted for more square cards */
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .container {
        padding: 0;
    }
    .hero-section {
        padding: 8rem 0;
    }
    .search-form {
        width: 350px;
    }
    .main-header .container {
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    .main-header .logo {
        width: auto;
        margin-bottom: 0;
    }
    .main-nav {
        order: unset;
        width: auto;
        margin-top: 0;
        justify-content: flex-start;
    }
    .main-nav .nav-links {
        display: flex;
    }
    .header-actions {
        width: auto;
        justify: flex-end;
        margin-top: 0;
    }
    .burger-menu-btn {
        display: none; /* Hide burger menu on desktop */
    }
}
