/* Burger Menu */
.burger-menu {
    display: block;
    cursor: pointer;
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1000;
}

.burger-menu .line {
    width: 30px;
    height: 3px;
    background-color: #fff;
    margin: 6px 0;
    transition: 0.4s;
}

.burger-menu.open .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.burger-menu.open .line2 {
    opacity: 0;
}

.burger-menu.open .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Navigation Panel */
.nav-panel {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: #1a1a2e;
    box-shadow: 2px 0 5px rgba(0,0,0,0.5);
    transition: 0.3s;
    z-index: 999;
    padding-top: 60px;
}

.nav-panel.open {
    left: 0;
}

.nav-panel a {
    display: block;
    padding: 15px 20px;
    color: #e0e0e0;
    text-decoration: none;
    transition: 0.3s;
}

.nav-panel a:hover {
    background-color: #3a3a5a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%); /* Deep Midnight Blue Gradient */
    color: #e0e0e0; /* Light Grey for readability */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(90deg, #2a2a4a 0%, #3a3a5a 100%); /* Darker blue-purple gradient */
    color: #ffffff; /* White text */
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(149, 100, 200, 0.5); /* Soft purple glow */
    position: relative;
    overflow: hidden; /* For moon/stars */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1; /* Ensure content is above moon/stars */
}

header h1 {
    margin-bottom: 0.5rem;
    font-size: 2.8em;
    text-shadow: 0 0 15px rgba(173, 216, 230, 0.8); /* Light blue glow */
    letter-spacing: 1px;
}

header p {
    font-size: 1.2em;
    color: #c0c0c0;
}

.language-selector {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2; /* Ensure selector is clickable */
}

.language-selector label {
    color: #e0e0e0;
    font-size: 1em;
}

.language-selector select {
    background: #3a3a5a; /* Dark purple */
    color: #e0e0e0;
    border: 1px solid #533483; /* Deep Purple border */
    padding: 8px;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(149, 100, 200, 0.4); /* Soft purple glow */
    appearance: none; /* Remove default select arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23e0e0e0%22%20d%3D%22M287%2C197.3L159.7%2C69.9c-4.4-4.4-11.4-4.4-15.8%2C0L5.4%2C197.3c-4.4%2C4.4-4.4%2C11.4%2C0%2C15.8l15.8%2C15.8c4.4%2C4.4%2C11.4%2C4.4%2C15.8%2C0l108.2-108.2l108.2%2C108.2c4.4%2C4.4%2C11.4%2C4.4%2C15.8%2C0l15.8-15.8C291.4%2C208.7%2C291.4%2C201.7%2C287%2C197.3z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 0.7em top 50%;
    background-size: 0.65em auto;
}

main {
    padding: 1.5rem;
    max-width: 900px;
    margin: 20px auto;
    flex-grow: 1;
}

section {
    background: rgba(42, 42, 74, 0.7); /* Semi-transparent dark blue-purple */
    margin: 25px 0;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(149, 100, 200, 0.4); /* Soft purple glow */
    border: 1px solid rgba(83, 52, 131, 0.5); /* Subtle border */
}

section h2 {
    color: #8d8dff; /* Light purple for headings */
    margin-bottom: 1.5rem;
    font-size: 2.2em;
    text-align: center;
    text-shadow: 0 0 10px rgba(141, 141, 255, 0.6); /* Light purple glow */
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px; /* Increased space */
}

label {
    font-size: 1.2em;
    color: #c0c0c0; /* Lighter grey for labels */
}

select#wake-up-time, select {
    padding: 12px;
    border: 1px solid #8d8dff; /* Light purple border */
    border-radius: 8px;
    font-size: 1.1em;
    width: 100%;
    max-width: 250px;
    box-sizing: border-box;
    background: #1a1a2e; /* Deep Midnight Blue */
    color: #e0e0e0;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(141, 141, 255, 0.5); /* Light purple glow */
    appearance: none; /* Remove default select arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23e0e0e0%22%20d%3D%22M287%2C197.3L159.7%2C69.9c-4.4-4.4-11.4-4.4-15.8%2C0L5.4%2C197.3c-4.4%2C4.4-4.4%2C11.4%2C0%2C15.8l15.8%2C15.8c4.4%2C4.4%2C11.4%2C4.4%2C15.8%2C0l108.2-108.2l108.2%2C108.2c4.4%2C4.4%2C11.4%2C4.4%2C15.8%2C0l15.8-15.8C291.4%2C208.7%2C291.4%2C201.7%2C287%2C197.3z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 0.7em top 50%;
    background-size: 0.65em auto;
}

button {
    background: linear-gradient(90deg, #533483 0%, #952d95 100%); /* Purple gradient */
    color: #ffffff;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 15px rgba(149, 100, 200, 0.6); /* Stronger purple glow */
}

button:hover {
    background: linear-gradient(90deg, #952d95 0%, #533483 100%); /* Reverse gradient on hover */
    box-shadow: 0 0 20px rgba(149, 100, 200, 0.8); /* More intense glow on hover */
}

#results {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid rgba(83, 52, 131, 0.5); /* Subtle border */
    padding-top: 20px;
    position: relative; /* Added for positioning the badge */
}

#results h3 {
    color: #8d8dff; /* Light purple */
    margin-bottom: 15px;
    font-size: 1.8em; /* Adjusted text size */
    text-shadow: 0 0 10px rgba(141, 141, 255, 0.6); /* Light purple glow */
}

#bedtimes {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping if space is too small, but prefer horizontal */
}

#bedtimes li {
    background: rgba(26, 26, 46, 0.8); /* Semi-transparent deep blue */
    color: #e0e0e0;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.1em; /* Adjusted text size */
    font-weight: bold;
    box-shadow: 0 0 12px rgba(173, 216, 230, 0.5); /* Light blue glow */
    border: 1px solid rgba(83, 52, 131, 0.3); /* Subtle border */
    flex: 1 1 auto; /* Allow items to grow and shrink, but maintain base size */
    min-width: 200px; /* Ensure a minimum width for each item */
    max-width: 30%; /* Limit max width to keep them on one line if possible */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    position: relative; /* Added for positioning the badge */
}

#bedtimes li .bedtime-time {
    font-size: 1.5em; /* Larger for the time */
    color: #aaffaa; /* Greenish glow */
    text-shadow: 0 0 8px rgba(170, 255, 170, 0.7);
}

#bedtimes li .bedtime-hours {
    font-size: 0.9em;
    color: #c0c0c0;
}

#bedtimes li .bedtime-desc {
    font-size: 0.8em;
    font-weight: normal;
    color: #b0b0b0;
}

.recommended-star {
    color: #ffd700; /* Gold color for star */
    font-size: 1.2em;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.7);
}

footer {
    text-align: center;
    padding: 1.5rem 0;
    background: #1a1a2e; /* Deep Midnight Blue */
    color: #c0c0c0;
    margin-top: 30px;
    box-shadow: 0 -2px 15px rgba(149, 100, 200, 0.5); /* Soft purple glow */
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #8d8dff;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #c0c0c0;
    text-shadow: 0 0 8px rgba(141, 141, 255, 0.6);
}

/* Moon and Stars */
.moon {
    position: absolute;
    top: 20px;
    left: 50px;
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8); /* White glow */
    animation: moon-float 10s ease-in-out infinite alternate;
    z-index: 0;
}

.star {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6); /* White glow */
    animation: star-twinkle 2s ease-in-out infinite alternate;
    z-index: 0;
}

.star:nth-child(1) { top: 50px; right: 100px; width: 5px; height: 5px; animation-delay: 0.5s; }
.star:nth-child(2) { top: 80px; right: 200px; width: 3px; height: 3px; animation-delay: 1.2s; }
.star:nth-child(3) { top: 120px; right: 50px; width: 7px; height: 7px; animation-delay: 0.8s; }

@keyframes moon-float {
    0% { transform: translateY(0px); }
    100% { transform: translateY(10px); }
}

@keyframes star-twinkle {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.recommended-badge-li {
    background-color: rgba(76, 175, 80, 0.6); /* Dulled green background */
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.5em;
    font-weight: bold;
    position: absolute;
    top: 0; /* Position from top */
    right: 0; /* Position from right */
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Interactive Tools Results Styling */
.debt-status {
    background: rgba(26, 26, 46, 0.8);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(83, 52, 131, 0.3);
}

.debt-status h4 {
    color: #8d8dff;
    margin-bottom: 10px;
    font-size: 1.4em;
    text-shadow: 0 0 10px rgba(141, 141, 255, 0.6);
}

.debt-surplus {
    border-left: 4px solid #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.debt-low {
    border-left: 4px solid #FFC107;
    background: rgba(255, 193, 7, 0.1);
}

.debt-moderate {
    border-left: 4px solid #FF9800;
    background: rgba(255, 152, 0, 0.1);
}

.debt-high {
    border-left: 4px solid #F44336;
    background: rgba(244, 67, 54, 0.1);
}

.nap-recommendation, .caffeine-schedule {
    background: rgba(26, 26, 46, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(83, 52, 131, 0.3);
    box-shadow: 0 0 12px rgba(173, 216, 230, 0.5);
}

.nap-recommendation h4, .caffeine-schedule h4 {
    color: #8d8dff;
    margin-bottom: 10px;
    font-size: 1.4em;
    text-shadow: 0 0 10px rgba(141, 141, 255, 0.6);
}

#debt-results, #nap-results, #caffeine-results {
    margin-top: 30px;
    border-top: 1px solid rgba(83, 52, 131, 0.5);
    padding-top: 20px;
}

#debt-results h3, #nap-results h3, #caffeine-results h3 {
    color: #8d8dff;
    margin-bottom: 15px;
    font-size: 1.8em;
    text-align: center;
    text-shadow: 0 0 10px rgba(141, 141, 255, 0.6);
}