/* CSS Variables for theming */
:root {
    --bg-primary: #111;
    --bg-secondary: #222;
    --bg-tertiary: #333;
    --bg-card: #222;
    --bg-day-hour: #2a2a1a;
    --bg-night-hour: #1a1a2a;
    --bg-night-next-day: #252535;
    --text-primary: white;
    --text-secondary: #888;
    --text-muted: #666;
    --accent-primary: #00ffcc;
    --accent-secondary: #00b38f;
    --accent-warning: #ff9900;
    --border-color: #333;
    --shadow-color: rgba(0, 255, 204, 0.3);
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-day-hour: #fef3c7;
    --bg-night-hour: #dbeafe;
    --bg-night-next-day: #bfdbfe;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-primary: #2563eb;
    --accent-secondary: #1d4ed8;
    --accent-warning: #dc2626;
    --border-color: #94a3b8;
    --shadow-color: rgba(37, 99, 235, 0.3);
}


body { 
    font-family: Arial, sans-serif; 
    text-align: center; 
    background-color: var(--bg-primary); 
    color: var(--text-primary); 
    margin: 0;
    padding: 140px 20px 20px 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}



/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);

    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
}

/* Language toggle button */
.lang-toggle {
    position: fixed;
    top: 20px;
    right: 80px;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}


.lang-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
}

h1 { margin-top: 10px; margin-bottom: 20px; }



.week-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.day-card {
    background-color: var(--bg-card);
    border-radius: 10px;
    padding: 15px;
    min-width: 180px;
    flex: 1;
    max-width: 280px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}


.day-card.today {
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 15px var(--shadow-color);
}







.day-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--accent-primary);
}
.day-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.day-ruler {
    font-size: 12px;
    color: var(--accent-warning);
    margin-bottom: 15px;
}
.sun-times {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.night-times {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-night-hour);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}





.hours-section {
    margin-bottom: 15px;
}
.section-title {
    font-size: 12px;
    color: #ffcc00;
    margin-bottom: 5px;
    text-transform: uppercase;
}
.hour-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 5px;
    margin: 2px 0;
    border-radius: 3px;
    font-size: 11px;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}


.day-hour {
    background-color: var(--bg-day-hour);
}
.night-hour {
    background-color: var(--bg-night-hour);
}

.hour-time {
    color: var(--text-secondary);
}
.hour-planet {
    font-weight: bold;
}

.hour-item.current {
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 10px var(--shadow-color);
    transform: scale(1.05);
    z-index: 10;
    position: relative;
}

.hour-item.current::before {
    content: attr(data-now);
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 8px;
    font-weight: bold;
    padding: 1px 6px;
    border-radius: 8px;
    z-index: 11;
}















/* Midnight divider for night hours spanning to next day */

.midnight-divider {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 6px 10px;
    background: linear-gradient(90deg, var(--bg-night-hour) 0%, var(--bg-tertiary) 50%, var(--bg-night-hour) 100%);
    border-top: 1px dashed var(--accent-primary);
    border-bottom: 1px dashed var(--accent-primary);
    border-radius: 4px;
    font-size: 10px;
}

.midnight-label {
    color: var(--accent-primary);
    font-weight: bold;
}

.next-day-date {
    color: var(--accent-primary);
    font-size: 12px;
}

/* Next day night hours styling */
.hour-item.night-hour.next-day {
    background-color: var(--bg-night-next-day);
}


.next-day-badge {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 8px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}






.planet-saturn { color: #c0c0c0; }
.planet-jupiter { color: #d4a574; }
.planet-mars { color: #ff6b6b; }
.planet-sun { color: #ffd700; }
.planet-venus { color: #98fb98; }
.planet-mercury { color: #87ceeb; }
.planet-moon { color: #e6e6fa; }

/* Light theme planet colors - darker for better readability */
[data-theme="light"] .planet-saturn { color: #64748b; }
[data-theme="light"] .planet-jupiter { color: #92400e; }
[data-theme="light"] .planet-mars { color: #dc2626; }
[data-theme="light"] .planet-sun { color: #b45309; }
[data-theme="light"] .planet-venus { color: #15803d; }
[data-theme="light"] .planet-mercury { color: #0369a1; }
[data-theme="light"] .planet-moon { color: #7c3aed; }
[data-theme="light"] .section-title { color: #b45309; }


.legend {
    margin-top: 20px;
    padding: 10px;
    background-color: #222;
    border-radius: 5px;
    display: inline-block;
}

.legend-item {
    display: inline-block;
    margin: 5px 10px;
    font-size: 12px;
}

.location-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    max-width: 500px;
    padding: 15px;
    background-color: var(--bg-secondary);
    border-radius: 0 0 10px 10px;
    border: 1px solid var(--border-color);
    border-top: none;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}






.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#locationInput {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}


#locationInput:focus {
    outline: none;
    border-color: var(--accent-primary);
}




.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-search {
    background-color: var(--accent-secondary);
    color: var(--bg-primary);
}







#resultsContainer {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 5px;
    display: none;
    text-align: left;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}


.result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    transition: background-color 0.2s ease;
}


.result-item:hover,
.result-item.selected {
    background-color: var(--bg-secondary);
}

.result-item.selected {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}





.result-item:last-child {

    border-bottom: none;
}

.location-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.location-info strong {
    color: var(--accent-secondary);
}

.status-msg {
    font-size: 12px;
    margin-top: 5px;
}

.status-loading { color: var(--accent-primary); }
.status-error { color: #ff6b6b; }




/* Responsive styles for mobile devices */
@media screen and (max-width: 1200px) {
    .week-container {
        gap: 12px;
        padding: 0 15px;
    }
    .day-card {
        max-width: 240px;
        min-width: 160px;
    }
}

@media screen and (max-width: 768px) {
    .week-container {
        gap: 10px;
        padding: 0 10px;
    }
    .day-card {
        flex: 1 1 45%;
        max-width: none;
        min-width: 140px;
        padding: 12px;
    }
    .day-header {
        font-size: 16px;
    }
    .day-date {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .week-container {
        gap: 8px;
        padding: 0 8px;
    }
    .day-card {
        flex: 1 1 100%;
        min-width: auto;
        padding: 10px;
    }
    .day-header {
        font-size: 15px;
    }
    .section-title {
        font-size: 11px;
    }
    .hour-item {
        font-size: 10px;
    }
}
