/* Advanced Vanilla CSS for MauExpat */

:root {
    --transition-speed: 0.3s;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s var(--ease-out) forwards;
}

.animate-slide-up {
    animation: slideUp 1s var(--ease-out) forwards;
}

.slide {
    opacity: 0 !important;
}

.slide.active {
    opacity: 1 !important;
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
}

/* Hero Section */
.hero {
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    background: linear-gradient(to bottom,
            rgba(15, 23, 42, 0.8) 0%,
            rgba(15, 23, 42, 0.4) 50%,
            rgba(15, 23, 42, 0.8) 100%);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Premium Cards */
.service-card,
.feature-card {
    transition: all 0.4s var(--ease-out);
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-card:hover,
.feature-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px var(--shadow-color);
    border-color: var(--accent-color);
}

.card-image {
    aspect-ratio: 16 / 10;
    width: 100%;
    background-size: cover;
    background-position: center 20%;
    /* Highlights the top area */
    transition: transform 0.6s var(--ease-out);
}

.service-card:hover .card-image,
.feature-card:hover .card-image {
    transform: scale(1.05);
}

/* Button Enhancements */
.button {
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-out) !important;
    z-index: 1;
}

.button:hover {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 12px 24px var(--shadow-color) !important;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: all 0.6s;
    z-index: -1;
}

.button:hover::before {
    left: 100%;
}

/* Glass Card for Sidebars */
.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 24px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

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

/* Badge */
.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 50px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Modern Header Blur */
.header {
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* Specific Page Styles */
.service-hero h1 {
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.main-content h2 {
    position: relative;
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.main-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

.main-content ul {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}

.main-content li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.main-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Mobile Sidebar Settings (Top) */
.mobile-settings-top {
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-setting-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--section-bg-color);
}

.mobile-setting-trigger {
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.mobile-setting-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease-out);
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
}

.mobile-setting-item.open .mobile-setting-dropdown {
    max-height: 300px;
    border-top: 1px solid var(--border-color);
}

.mobile-lang-option {
    padding: 0.875rem 1.25rem;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-lang-option:hover,
.mobile-lang-option.active {
    background: var(--accent-color);
    color: white;
}

.mobile-theme-item {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--section-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

@media (max-width: 991px) {

    .desktop-nav,
    .desktop-actions {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex !important;
    }
}

/* Mobile Rendering Fixes (Galaxy S8 & Smaller) */
@media (max-width: 768px) {
    .hero-carousel .hero-text h1 {
        font-size: 2.25rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.2 !important;
    }

    .hero-carousel .hero-actions {
        margin-bottom: 3.5rem !important;
    }
}

@media (max-width: 480px) {
    .hero-carousel .hero-text h1 {
        font-size: 1.5rem !important;
    }

    .hero-carousel .hero-text p {
        font-size: 0.85rem !important;
        margin-bottom: 1.25rem !important;
    }

    .hero-carousel .hero-actions {
        margin-bottom: 4.5rem !important;
        gap: 0.5rem !important;
    }

    .carousel-dots {
        bottom: 1.25rem !important;
    }

    .nav-btn {
        display: none !important;
    }

    /* Cookie Banner Fixes */
    .cookie-banner {
        padding: 0.625rem 0.5rem !important;
        bottom: 0.5rem !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }

    .cookie-actions {
        gap: 0.375rem !important;
    }

    .cookie-banner .button-primary,
    .cookie-banner .button-outline {
        padding: 0.5rem !important;
        font-size: 0.75rem !important;
        min-width: 0 !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 360px) {
    .hero-carousel .hero-actions {
        margin-bottom: 5.5rem !important;
    }

    .carousel-dots {
        bottom: 1.5rem !important;
    }
}

/* Button Text Wrapping & Dots Visibility Fixes */
@media (max-width: 480px) {
    .hero-actions .button {
        white-space: nowrap !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
    }
}

@media (max-width: 360px) {
    .hero-carousel .hero-actions {
        margin-bottom: 4rem !important;
        /* Move up slightly to bring dots into view */
    }

    .carousel-dots {
        bottom: 1.25rem !important;
    }
}

/* Final Mobile Rendering Fixes (Galaxy S8) */
@media (max-width: 480px) {
    .header-inner {
        height: 60px !important;
    }

    .hero-carousel {
        height: calc(100vh - 60px) !important;
        min-height: 500px !important;
    }

    .hero-carousel .hero-text {
        padding-top: 2rem !important;
    }

    .hero-carousel .hero-text p {
        font-size: 0.825rem !important;
        margin-bottom: 1rem !important;
        -webkit-line-clamp: 2 !important;
    }

    .hero-carousel .hero-actions {
        margin-bottom: 3.5rem !important;
        width: 100% !important;
        padding: 0 1rem !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .hero-carousel .hero-actions .button {
        width: 100% !important;
        white-space: normal !important;
        text-align: center !important;
        box-sizing: border-box !important;
        font-size: 0.875rem !important;
        padding: 0.6rem !important;
    }

    .carousel-dots {
        bottom: 1rem !important;
        z-index: 10 !important;
    }

    .dot {
        width: 8px !important;
        height: 8px !important;
    }

    /* Cookie Banner Robust Fix */
    .cookie-banner {
        left: 0.75rem !important;
        right: 0.75rem !important;
        bottom: 0.75rem !important;
        width: auto !important;
        max-width: none !important;
        padding: 0.75rem !important;
    }

    .cookie-content {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .cookie-text-wrapper {
        text-align: center !important;
        flex-direction: column !important;
    }

    .cookie-actions {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }
}

@media (max-width: 360px) {
    .cookie-actions {
        grid-template-columns: 1fr !important;
    }
}