/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1e1b4b;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Fixed Location Header */
.location-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(67, 56, 202, 0.1);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(67, 56, 202, 0.08);
}

.location-selector {
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.location-icon {
    font-size: 1.5rem;
    color: #4338ca;
}

#locationInput {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e7ff;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

#locationInput:focus {
    border-color: #4338ca;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

.location-dropdown {
    position: absolute;
    top: 100%;
    left: 2.25rem;
    right: 0;
    background: white;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(67, 56, 202, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.location-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.location-option:hover,
.location-option.selected {
    background-color: #f8fafc;
}

.location-option.selected {
    background-color: #e0e7ff;
    color: #4338ca;
    font-weight: 500;
}

.location-option:last-child {
    border-bottom: none;
}

/* View Toggle */
.view-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.view-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e7ff;
    background: white;
    color: #64748b;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn:hover {
    border-color: #4338ca;
    color: #4338ca;
}

.view-btn.active {
    background: #4338ca;
    border-color: #4338ca;
    color: white;
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.25);
}

/* Cities Selector */
.cities-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.city-selector {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vs-divider {
    font-weight: 700;
    font-size: 1.2rem;
    color: #4338ca;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 2px solid #e0e7ff;
    box-shadow: 0 2px 8px rgba(67, 56, 202, 0.1);
}

#city1Input,
#city2Input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e7ff;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

#city1Input:focus,
#city2Input:focus {
    border-color: #4338ca;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

#city1Dropdown,
#city2Dropdown {
    position: absolute;
    top: 100%;
    left: 2.25rem;
    right: 0;
    background: white;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(67, 56, 202, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Month Navigation */
.month-navigation {
    position: sticky;
    top: 130px; /* A bit more space below header */
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem; /* Less margin to prevent overlap */
    background: rgba(255, 255, 255, 0.98); /* More opaque */
    padding: 1rem 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(67, 56, 202, 0.1);
    border: 1px solid rgba(67, 56, 202, 0.1);
}

.nav-button {
    background: white;
    border: 2px solid #e0e7ff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #4338ca;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.15);
}

.nav-button:hover:not(:disabled) {
    background: #4338ca;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 56, 202, 0.25);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.month-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4338ca;
    text-shadow: none;
    text-align: center;
    min-width: 300px;
}

/* Comparison Container */
.comparison-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(67, 56, 202, 0.15);
    overflow: hidden;
    border: 1px solid rgba(67, 56, 202, 0.1);
}

.dates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
}

.column {
    padding: 2rem;
}

.current-column {
    border-right: 1px solid #e0e7ff;
}

.column-header {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4338ca;
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e7ff;
}

.dates-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Date Items */
.date-item {
    padding: 1rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.date-item:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.1);
}

.date-item.today {
    background: linear-gradient(135deg, #4338ca, #5b21b6);
    color: white;
    border-color: #4338ca;
    box-shadow: 0 8px 25px rgba(67, 56, 202, 0.3);
}

.date-header {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: inherit;
}

.date-item.today .date-header {
    color: white;
}

.twilight-times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.5rem;
}

.date-item.today .twilight-times {
    color: rgba(255, 255, 255, 0.9);
}

.twilight-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.date-item.today .twilight-time {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.time-icon {
    font-size: 0.75rem;
}

.time-label {
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    background: rgba(67, 56, 202, 0.95);
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    min-width: 280px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-indicator p {
    margin: 0.5rem 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.loading-indicator small {
    opacity: 0.8;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .location-header {
        padding: 1rem;
    }
    
    .cities-selector {
        flex-direction: column;
        gap: 1rem;
    }
    
    .vs-divider {
        transform: rotate(90deg);
        font-size: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .month-title {
        font-size: 2rem;
        min-width: 250px;
    }
    
    .dates-grid {
        grid-template-columns: 1fr;
    }
    
    .current-column {
        border-right: none;
        border-bottom: 1px solid #e0e7ff;
    }
    
    .column {
        padding: 1.5rem;
    }
    
    .month-navigation {
        top: 100px; /* Adjust for smaller header on mobile */
        gap: 1rem;
        padding: 1rem;
        margin-bottom: 2rem;
    }
    
    .nav-button {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .location-selector {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .location-icon {
        align-self: center;
    }
    
    .cities-selector {
        gap: 0.5rem;
    }
    
    .city-selector {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .city-selector .location-icon {
        align-self: center;
    }
    
    .view-toggle {
        gap: 0.25rem;
    }
    
    .view-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .month-navigation {
        top: 80px; /* Even smaller adjustment for tiny screens */
        padding: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .month-title {
        font-size: 1.75rem;
        min-width: 200px;
    }
    
    .twilight-times {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .twilight-time {
        justify-content: center;
    }
}

/* Mobile App Instructions View */
.mobile-app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.mobile-app-content {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 4px 6px rgba(67, 56, 202, 0.1);
}

.mobile-app-content h1 {
    color: #4338ca;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.install-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 4px solid #4338ca;
}

.install-section h2 {
    color: #1f2937;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.install-section ol,
.install-section ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.install-section li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: #374151;
}

.install-section strong {
    color: #1f2937;
}

.tip {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #e0e7ff;
    border-radius: 8px;
    color: #4338ca;
    font-size: 0.9rem;
}

.benefits {
    border-left-color: #10b981;
}

.benefits h2 {
    color: #10b981;
}

.benefits ul {
    list-style: none;
    padding-left: 0;
}

.benefits li {
    padding-left: 1.5rem;
    position: relative;
}

.benefits li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.install-note {
    margin-top: 2rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
    border: 1px solid #f59e0b;
}

.install-note p {
    margin: 0;
    color: #92400e;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .mobile-app-content {
        padding: 1.5rem;
    }
    
    .mobile-app-content h1 {
        font-size: 1.5rem;
    }
    
    .install-section {
        padding: 1rem;
    }
    
    .install-section h2 {
        font-size: 1.25rem;
    }
}

/* Golden Hour Toggle */
.golden-hour-toggle {
    text-align: center;
    margin: -1rem 0 1.5rem 0;
}

.toggle-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    background: #f9fafb;
    border-color: #4338ca;
    color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(67, 56, 202, 0.1);
}

.toggle-btn.active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #f59e0b;
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.toggle-btn.active:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.toggle-icon {
    font-size: 1.25rem;
}

/* Golden Hour Times Styling */
.twilight-time.golden-hour {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.twilight-time.golden-hour.hidden {
    display: none;
    opacity: 0;
    max-height: 0;
}

.twilight-time.golden-hour .time-label {
    color: #92400e;
    font-weight: 600;
}

.twilight-time.golden-hour:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.2);
}

/* Light After Work Card */
.light-after-work-card {
    max-width: 600px;
    margin: 0 auto 2rem auto;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sun-arc-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    opacity: 0.4;
    pointer-events: none;
}

.sun-arc {
    width: 100%;
    height: 100%;
}

.light-after-work-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.light-after-work-card.has-light {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.light-after-work-card.has-light:hover {
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.card-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.card-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.card-text {
    flex: 1;
}

.card-text h3 {
    margin: 0 0 0.5rem 0;
    color: #1e3a8a;
    font-size: 1.5rem;
    font-weight: 700;
}

.light-after-work-card.has-light h3 {
    color: #92400e;
}

.countdown-message {
    color: #1e40af;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.light-after-work-card.has-light .countdown-message {
    color: #b45309;
}

.countdown-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1e3a8a;
    text-shadow: 0 2px 4px rgba(30, 58, 138, 0.1);
}

.light-after-work-card.has-light .countdown-value {
    color: #92400e;
    text-shadow: 0 2px 4px rgba(146, 64, 14, 0.1);
}

@media (max-width: 768px) {
    .light-after-work-card {
        padding: 1rem;
    }
    
    .card-content {
        gap: 1rem;
    }
    
    .card-icon {
        font-size: 2rem;
    }
    
    .card-text h3 {
        font-size: 1.25rem;
    }
    
    .countdown-value {
        font-size: 1.5rem;
    }
}