:root {
    --bg-dark: #020617;
    --card-bg: rgba(15, 23, 42, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --success-bg: rgba(16, 185, 129, 0.2);
    --success-text: #34d399;
    --danger-bg: rgba(239, 68, 68, 0.2);
    --danger-text: #f87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #020617 100%);
    color: var(--text-main);
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background-attachment: fixed;
    background-size: cover;
}

/* --- Layout & Header --- */
.centered-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.mini-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.mini-logo i {
    color: white !important;
}

.header-brand .page-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.search-section-compact {
    flex-grow: 1;
    max-width: 650px;
}

.input-group-compact {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(2, 6, 23, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0 0.5rem;
    height: 48px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.input-group-compact:focus-within {
    border-color: var(--accent);
    background: rgba(2, 6, 23, 0.95);
    box-shadow: 0 0 25px rgba(37, 99, 235, 0.25), 0 4px 20px rgba(0, 0, 0, 0.4);
}

.search-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    margin-left: 0.25rem;
    font-weight: 400;
}

.input-group-compact .main-input {
    background: transparent !important;
    border: none !important;
    padding: 0.75rem 0 !important;
    margin-right: 0.5rem;
    font-size: 0.95rem;
    width: 100%;
    color: white;
    height: 100%;
}

.input-group-compact i:first-child {
    color: var(--accent);
    margin: 0 0.75rem;
    position: static;
    transform: none;
}

/* Fix clear button alignment in compact view */
.input-group-compact .clear-btn {
    position: static;
    transform: none;
    margin-right: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.input-group-compact .clear-btn:hover {
    color: white;
}

.input-group-compact .main-input:focus {
    box-shadow: none;
}

.search-icon-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    color: white !important;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 0.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.search-icon-btn i {
    color: white !important;
    font-size: 1rem;
}

.search-icon-btn:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.6);
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

#resultsContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.sub-card {
    width: 100%;
    max-width: 550px;
    margin: 0;
    height: auto;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1100px) {
    #resultsContainer {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
        max-width: 1200px;
        margin: 0 auto;
    }

    /* Center if only one item in grid */
    #resultsContainer:has(> .sub-card:last-child:first-child) {
        display: flex;
        justify-content: center;
    }
}

/* --- Cards Common --- */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    /* Top highlight */
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.6s ease-out backwards;
    width: 100%;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* Mouse hover glow effect */
.glass-card::before,
.instructions-block::before,
.accordion-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(400px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.08), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.glass-card:hover::before,
.instructions-block:hover::before,
.accordion-header:hover::before {
    opacity: 1;
}

.glass-card>*,
.instructions-block>*,
.accordion-header>* {
    position: relative;
    z-index: 1;
}

/* --- Initial Hero View Styles --- */
.initial-view-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 600px;
    margin: 4rem auto 2rem;
    animation: fadeIn 0.6s ease-out;
}

.hero-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.4);
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.hero-search-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    text-align: left;
}

.hero-input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.hero-input-group {
    position: relative;
    margin-bottom: 1rem;
    width: 100%;
}

.hero-input-group i.fa-envelope {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    z-index: 10;
}

.clear-btn-hero {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.clear-btn-hero:hover {
    color: white;
}

.hero-input {
    width: 100%;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.875rem 1rem 0.875rem 3.25rem;
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
    display: block;
}

.hero-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.hero-helper-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.hero-tip {
    font-size: 0.85rem;
    color: #60a5fa;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-primary-btn {
    width: 100%;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.2s;
    display: block;
}

.hero-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

/* Search Section - Generic */
.input-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.input-group {
    position: relative;
    margin-bottom: 0.75rem;
    width: 100%;
}

/* Icon positioning */
.input-group i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.input-group .fa-envelope {
    left: 1rem;
    color: var(--accent);
}

.input-group .clear-btn {
    right: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.input-group .clear-btn:hover {
    color: white;
}

.main-input {
    width: 100%;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.875rem 1rem 0.875rem 3rem;
    /* Left padding for icon */
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
    display: block;
}

.main-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.helper-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.primary-btn {
    width: 100%;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.875rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.2s;
    display: block;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

/* --- Profile Header Styles --- */

/* --- New Profile Card Styles --- */
.marquee-glass-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    min-width: 140px;
    height: 120px;
    background: rgba(30, 41, 59, 0.4); /* Darker semi-transparent background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05); /* Very subtle border */
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6); /* Muted text */
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
    margin: 0 0.5rem; /* Space between cards */
}

.marquee-glass-card:hover {
    background: rgba(30, 41, 59, 0.8);
    color: white;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.marquee-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.marquee-glass-card:hover .marquee-logo {
    transform: scale(1.05);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}

.profile-icon.expired {
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.profile-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.profile-details p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.renewal-strip {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: white;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.renewal-strip .days-left {
    color: #60a5fa;
    font-weight: 400;
    margin-left: 0.25rem;
}

.renewal-strip.expired {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.renewal-strip .days-ago {
    color: #f87171;
    font-weight: 400;
    margin-left: 0.25rem;
}

/* --- Common Instructions Card --- */
.common-instructions-card {
    margin: 0;
}

.instructions-accordion {
    width: 100%;
}

.accordion-header {
    width: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.accordion-header:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.accordion-title {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.accordion-arrow {
    width: 36px;
    height: 36px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.instructions-accordion.active .accordion-arrow {
    transform: rotate(180deg);
    background: var(--accent);
    color: white;
    box-shadow: 0 0 20px var(--accent);
}

.accordion-content-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.instructions-accordion.active .accordion-content-wrapper {
    max-height: 1200px;
    opacity: 1;
    margin-top: 1rem;
}

.instructions-block {
    background: rgba(15, 23, 42, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    box-sizing: border-box;
}

.grid-2x2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 900px) {
    .grid-2x2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        grid-auto-flow: row;
        align-items: stretch;
        gap: 0;
    }

    .instruction-item {
        height: 100%;
        box-sizing: border-box;
        border-right: 1px solid rgba(255, 255, 255, 0.05);
    }

    .instruction-item:nth-child(2n) {
        border-right: none;
        padding-left: 1.5rem;
    }

    .instruction-item:nth-child(2n-1) {
        padding-right: 1.5rem;
    }
}

.icon-gradient {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Removed instruction hover effect */
.instruction-item {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Remove border from last items in the grid depending on layout */
@media (min-width: 900px) {
    .instruction-item:nth-child(n+3) {
        border-bottom: none;
    }
}

@media (max-width: 899px) {
    .instruction-item:last-child {
        border-bottom: none;
    }
}

.instruction-item h4 {
    font-size: 0.9rem;
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-bullet {
    font-size: 0.5rem;
    color: var(--accent);
    filter: drop-shadow(0 0 5px var(--accent));
}

.instruction-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.support-text-common {
    width: 100%;
    text-align: center;
    padding: 1rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Detailed Info Section */
.detailed-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.detailed-title {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 500;
}

.detailed-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* --- Logo Marquee --- */
.marquee-wrapper {
    width: 100%;
    margin-top: auto;
    overflow: hidden;
    position: relative;
    padding: 0.5rem 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: marqueeScroll 25s linear infinite;
}

.marquee-bullet {
    width: 7px;
    height: 7px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
    display: block;
    flex-shrink: 0;
}

.marquee-card {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: max-content;
    transition: all 0.3s ease;
    color: #ffffff;
    opacity: 0.6;
}

.marquee-card:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.marquee-card:hover .marquee-bullet {
    box-shadow: 0 0 18px #ffffff;
}

.marquee-card span:not(.marquee-bullet) {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Loaders */
.loading-spinner {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 2rem;
    grid-column: span 2;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

/* Empty State Styles are handled inline in index.php but we can fix here too */
#emptyState {
    grid-column: span 2;
    padding: 3rem;
    animation: slideUp 0.5s ease;
}

/* Empty State */
#emptyState {
    width: 100%;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 0.75rem));
    }
}

/* --- Language Selector --- */
.lang-selector {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-btn {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.lang-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

.lang-btn i.fa-chevron-down {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-dropdown.open .lang-btn i.fa-chevron-down {
    transform: rotate(180deg);
}

.lang-dropdown.open .lang-btn {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(59, 130, 246, 0.5);
}

.lang-menu {
    position: absolute;
    top: 120%;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 140px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    transform-origin: top right;
    animation: fadeIn 0.2s ease-out;
}

.lang-menu.hidden {
    display: none;
}

.lang-menu li {
    padding: 0.6rem 1.2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-menu li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.lang-menu li.active {
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    font-weight: 600;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideIn 0.3s ease-out;
}

.toast.success i {
    color: var(--success-text);
}

.toast.error i {
    color: var(--danger-text);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@media (max-width: 900px) {
    .grid-2x2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .centered-layout {
        padding: 1.5rem 1rem;
        max-width: 100%;
    }

    .app-header {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        text-align: center;
        padding: 1.5rem; 
        /* Removed bottom padding because language selector is now fixed viewport */
    }

    .header-left {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-section-compact {
        width: 100%;
        max-width: 100%;
    }

    .search-subtitle {
        text-align: center;
        margin-left: 0;
    }

    .sub-card {
        width: 100%;
        max-width: 100%;
    }

    .instruction-item {
        padding: 1rem 0 !important;
        border-right: none !important;
    }

    .instruction-item:nth-child(2n) {
        padding-left: 0 !important;
    }

    .instruction-item:nth-child(2n-1) {
        padding-right: 0 !important;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.25rem;
    }

    .input-group-compact {
        height: 52px;
        /* Slightly taller for better touch targets */
    }

    .input-group-compact .main-input {
        font-size: 0.9rem;
    }

    .accordion-header {
        padding: 1rem;
    }

    .accordion-title {
        font-size: 0.9rem;
    }

    .accordion-arrow {
        width: 32px;
        height: 32px;
    }

    .marquee-card {
        padding: 0.5rem 1.25rem;
    }

    .marquee-card span:not(.marquee-bullet) {
        font-size: 0.75rem;
        letter-spacing: 1.5px;
    }

    .marquee-bullet {
        width: 5px;
        height: 5px;
    }

    .support-text-common {
        font-size: 0.8rem;
        padding: 1.5rem 1rem;
    }

    /* Language selector for mobile within compact header */
    .app-header {
        position: relative; /* ensure it's positioned for any internal z-indexing but doesn't trap fixed children */
    }

    /* Move it completely outside the glass card in mobile view */
    .app-header .lang-selector,
    .lang-selector {
        position: fixed !important;
        top: 1rem !important;
        right: 1rem !important;
        bottom: auto !important;
        z-index: 9999 !important;
    }
    
    /* Push the main layout down so it doesn't overlap with the top-right button */
    .centered-layout {
        padding-top: 4rem; 
    }
}