:root {
    --primary-color: #d4af37; /* Gold */
    --secondary-color: #f1c40f; /* Amber */
    --accent-roja: #e91e63; /* Pink for Roja pill */
    --accent-loc: #2196f3; /* Blue for Location pill */
    --bg-overlay: rgba(0, 0, 0, 0.75);
    --text-color: #ffffff;
    --text-muted: #e2e8f0;
    --font-heading: 'Amiri', serif;
    --font-body: 'Montserrat', sans-serif;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: #1a202c;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: zoomIn 60s infinite alternate;
}

@keyframes zoomIn {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
    backdrop-filter: blur(3px);
}

.app-container {
    width: 100%;
    max-width: 600px;
    height: 100vh; /* Full height for mobile feeling */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 2rem;
    z-index: 1;
}

/* Brand Logo */
.brand-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    opacity: 0.9;
    transition: opacity 0.3s;
}

.brand-logo:hover {
    opacity: 1;
}

/* Header */
.header-minimal {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    position: relative;
}

.info-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
}

.info-icon:hover {
    opacity: 1;
    color: var(--primary-color);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: #2d3748;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.modal-header h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body p {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.modal-body strong {
    color: var(--text-color);
}

.separator {
    opacity: 0.5;
}

/* Timer */
.timer-wrapper {
    margin-bottom: 3rem;
}

.timer-label {
    font-size: 1.1rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.timer-digits {
    font-family: var(--font-body); /* Montserrat usually better for digits than Amiri */
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 12px rgba(0,0,0,0.5);
    background: linear-gradient(180deg, #fff, #cbd5e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Pills */
.pills-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative; /* For dropdown positioning */
    user-select: none;
}

.pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.badge-pill {
    background: rgba(233, 30, 99, 0.2);
    color: #ff80ab;
    border-color: rgba(233, 30, 99, 0.3);
}

.location-pill {
    background: rgba(33, 150, 243, 0.2);
    color: #90caf9;
    border-color: rgba(33, 150, 243, 0.3);
}

.pill-icon {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

svg.pill-icon {
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
}

.chevron {
    opacity: 0.7;
    margin-left: 0.25rem;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    bottom: 120%; /* Opens upwards */
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    max-height: 400px;
    background: #2d3748;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    text-align: left;
    color: var(--text-color);
}

.search-container {
    position: relative;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 14px;
    height: 14px;
}

#location-search {
    width: 100%;
    padding: 0.6rem 0.6rem 0.6rem 2.2rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    color: white;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
}

#location-search:focus {
    border-color: var(--primary-color);
    background: rgba(0,0,0,0.4);
}

.hidden {
    display: none;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    color: white;
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-align: left;
}

.gps-item {
    justify-content: flex-start;
    gap: 0.75rem;
    color: var(--accent-loc);
    font-weight: 600;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.1);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0.5rem 0;
}

.toggle-item {
    justify-content: space-between;
    cursor: default;
}

.toggle-item:hover {
    background: none;
}

.small-toggle {
    width: 36px;
    height: 20px;
}

.small-toggle .slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.small-toggle input:checked + .slider:before {
    transform: translateX(16px);
}

.list-view {
    overflow-y: auto;
    max-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.district-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Scrollbar for list */
.list-view::-webkit-scrollbar {
    width: 4px;
}
.list-view::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.list-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-weight: 700;
}

.back-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.5rem;
}

.back-btn:hover {
    color: white;
}

.primary-button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: #1a202c;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'Hind Siliguri', sans-serif;
}

.primary-button:hover {
    background: var(--secondary-color);
}

/* Footer */
.times-footer {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(26, 32, 44, 0.8); /* Darker, more solid background */
    padding: 1.5rem 3rem; /* Increased padding */
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3); /* Subtle gold border */
    backdrop-filter: blur(15px);
    width: 90%;
    max-width: 500px; /* Slightly wider */
    justify-content: space-between; /* Use space-between for better separation */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); /* Stronger shadow */
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center align */
    gap: 0.5rem;
}

/* Removed time-icon and simplified wrapper */

.time-label-small {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.time-value-small {
    font-size: 2.2rem; /* Much larger */
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-body); /* Use Montserrat for clean, modern look */
    line-height: 1;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3); /* Gold glow */
}

.footer-divider {
    width: 1px;
    height: 60px; /* Taller divider */
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.3), transparent);
}

/* Progress Bar */
.progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.05);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-roja));
    width: 0%;
    transition: width 1s linear;
}

/* Responsive Mobile Optimization */
@media (max-width: 480px) {
    .app-container {
        padding: 1rem;
        justify-content: center; /* Center content vertically */
        padding-top: 1rem;
        min-height: 100vh; /* Keep full height for centering */
        height: auto;
    }

    /* Logo - Minimalistic */
    .brand-logo {
        max-width: 100px; /* Smaller logo */
        margin-bottom: 0.5rem;
    }

    /* Header - Compact */
    .header-minimal {
        margin-bottom: 1rem;
        font-size: 0.65rem; /* Smaller font to fit one line */
        padding: 0.3rem 0.5rem;
        white-space: nowrap; /* Force one line */
        width: auto;
        max-width: 95%; /* Prevent overflow */
        justify-content: center;
    }

    /* Timer - Responsive */
    .timer-wrapper {
        margin-bottom: 1.5rem;
        margin-top: 0.5rem;
    }

    .timer-digits {
        font-size: 12vw; /* Slightly smaller */
    }
    
    .timer-label {
        font-size: 0.8rem;
    }

    /* Pills - Compact row */
    .pills-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1.5rem; /* Reduced space */
        justify-content: center;
    }
    
    .pill {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Footer - Integrated and Visible */
    .times-footer {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        margin-top: 0; /* Don't push to bottom */
        margin-bottom: 0;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        background: rgba(26, 32, 44, 0.6); /* More transparent */
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 12px;
    }

    .time-block {
        gap: 0.25rem;
    }

    .time-value-small {
        font-size: 1.5rem; /* Readable but not huge */
    }
    
    .time-label-small {
        font-size: 0.7rem;
    }
    
    .footer-divider {
        height: 30px;
    }

    .time-value-small {
        font-size: 1.8rem; /* Clear and visible */
    }
    
    .time-label-small {
        font-size: 0.75rem;
    }
    
    .footer-divider {
        height: 40px;
    }

    .dropdown-menu {
        width: 260px;
        bottom: 110%;
    }
}
