/* --- Color Palette from User --- */
:root {
    --black-bean: #3C140A;
    --rust: #B24A06;
    --xanthous: #F9C150;
    --butterscotch: #D5892B;
    --russet: #894619;
    --white: #FFFFFF;
    --soft-off-white: #fffcfa; /* From original overlay-text color */
}

/* Basic Resets & Global Styles */
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    font-family: 'Pixelify Sans', cursive;
    background-color: var(--black-bean);
    color: var(--white);
}

/* --- Index.html Specific Styles --- */
.image-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.3) brightness(0.85) contrast(1.1);
    display: block;
}

.overlay-text {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--soft-off-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6), -2px -2px 4px rgba(0, 0, 0, 0.6), -2px 2px 4px rgba(0, 0, 0, 0.6), 2px -2px 4px rgba(0, 0, 0, 0.6);
    font-size: 5em;
    font-weight: bold;
    letter-spacing: 2px;
    white-space: nowrap;
    animation: fadeInScale 1.5s ease-out forwards;
    z-index: 5;
}

.overlay-text-bottom {
    position: absolute;
    bottom: 35%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Pixelify Sans', cursive;
    font-size: 3em;
    color: var(--soft-off-white);
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6), -2px -2px 4px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    z-index: 5;
}

.room-selection-buttons {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px; /* Increased gap for better spacing between longer buttons */
    z-index: 6;
    /* Removed flex-wrap here to force them on one line by default */
    justify-content: center;
    padding: 0 20px;
    width: auto; /* Let content dictate width */
    max-width: 90%; /* Prevent stretching too wide */
    white-space: nowrap; /* Keep buttons on one line */
}

.room-btn {
    background-color: var(--rust);
    color: var(--white);
    padding: 15px 30px;
    border: 2px solid var(--russet);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2em;
    font-family: 'Pixelify Sans', cursive;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    /* Removed flex: 1, min-width, max-width to allow content to dictate length */
    width: auto; /* Allow button to size to its content */
    flex-shrink: 0; /* Prevent buttons from shrinking too much if space is tight (for larger screens) */
    display: inline-block; /* Make sure text does not wrap and button behaves like an inline block */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    text-align: center;
}

.room-btn:hover {
    background-color: var(--butterscotch);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 0 20px 5px var(--xanthous), 0 6px 15px rgba(0, 0, 0, 0.5);
}


/* --- Top Navigation Buttons (General) --- */
.top-buttons {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 20px; /* Consistent gap between buttons */
    z-index: 10;
    align-items: center; /* **Crucial for vertical alignment** */
}

.top-btn {
    background-color: var(--rust);
    color: var(--white);
    padding: 12px 25px;
    border: 2px solid var(--russet);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-family: 'Pixelify Sans', cursive;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative; /* Keep for potential inner positioning */
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping */
    display: inline-flex; /* Use flex to easily center content if needed */
    align-items: center; /* Center text vertically */
    justify-content: center; /* Center text horizontally */
}

.top-btn:hover {
    background-color: var(--butterscotch);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 0 20px 5px var(--xanthous), 0 6px 15px rgba(0, 0, 0, 0.5);
}

/* --- Dropdown for Room Navigation --- */
.dropdown {
    position: relative;
    /* Inherit flex properties from .top-buttons */
    /* No need for display: inline-block here, as it's a direct child of a flex container */
    /* This button needs to explicitly get .top-btn styling */
}

/* Ensure the dropdown button itself is styled as a top-btn */
.dropdown .top-btn.dropbtn {
    /* No additional styles needed here, it inherits correctly now */
}

.dropdown-wrapper { /* This wrapper is not actually used in the provided HTML structure. You can likely remove it from the CSS. */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 5px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--black-bean);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
    z-index: 3;
    border-radius: 8px;
    padding: 10px 0;
    top: calc(100% + 10px); /* Position below the button with a small gap */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap; /* Prevent content wrapping */
    border: 2px solid var(--russet); /* Add border for consistency */
}

.dropdown-content a {
    color: var(--soft-off-white);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-family: 'Pixelify Sans', cursive;
    font-size: 1em;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-align: center;
}

.dropdown-content a:hover {
    background-color: var(--russet);
    color: var(--xanthous);
}

/* Modified hover to display dropdown content */
/* Make sure the dropdown content displays when hovering over the .dropdown container */
/* Shows the menu and keeps it open */
.dropdown:hover .dropdown-content,
.dropdown-content:hover {
    display: block;
}

/* --- About Popup Styling --- */
.popup {
    width: 400px;
    background: var(--soft-off-white);
    border-radius: 12px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.1);
    text-align: center;
    padding: 40px;
    color: var(--black-bean);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
    z-index: 1001;
}

.open-popup {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.popup h2 {
    font-size: 2.5em;
    font-weight: 500;
    margin: 15px 0 10px;
    color: var(--rust);
}

.popup p {
    font-family: 'Lora', serif; /* Keep Lora for body text */
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
}

.popup button {
    width: 50%;
    margin-top: 30px;
    padding: 12px 0;
    background: var(--rust);
    color: var(--white);
    border: 0;
    outline: none;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.popup button:hover {
    background: var(--butterscotch);
    transform: translateY(-2px);
}


/* --- Room1.html Specific Styles --- */
.room_background {
    position: relative;
    width: 100vw;
    height: 100vh;
    /* --- GIF BACKGROUND (Sharper & 40% Transparent --- */
    background-image: linear-gradient(rgba(60, 20, 10, 0.6), rgba(60, 20, 10, 0.9)), url('placeholder.gif'); /* 60% Black overlay for ~40% GIF transparency */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--black-bean); /* Fallback */
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;

}




.main-buttons {
    display: flex;
    gap: 40px;
    margin-top: 50px;
    z-index: 5;
    flex-wrap: wrap;
    justify-content: center;
}

.circle-btn {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: var(--rust);
    color: var(--white);
    border: 4px solid var(--russet);
    font-family: 'Pixelify Sans', cursive;
    font-size: 1.5em;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.circle-btn:hover {
    background-color: var(--butterscotch);
    transform: translateY(-10px) scale(1.1);
    box-shadow: 0 0 30px 10px var(--xanthous), 0 15px 25px rgba(0, 0, 0, 0.6);
    border-color: var(--xanthous);
}

.circle-btn:active {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
}


/* --- Pomodoro Timer Pop-up Styling --- */
.timer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(60, 20, 10, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timer-overlay.active {
    display: flex;
    opacity: 1;
}

.timer-popup {
    background-color: var(--soft-off-white);
    border: 4px solid var(--butterscotch);
    border-radius: 20px;
    padding: 30px 40px;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
    font-family: 'Lora', serif;
    color: var(--black-bean);
    text-align: center;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.timer-overlay.active .timer-popup {
    transform: scale(1);
    opacity: 1;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.popup-title {
    margin: 0;
    font-size: 2em;
    color: var(--rust);
    font-family: 'Pixelify Sans', cursive;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--russet);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.2) rotate(90deg);
    color: var(--butterscotch);
}

.time-display {
    font-size: 5em;
    margin: 20px 0 10px;
    font-weight: bold;
    color: var(--black-bean);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    transition: color 0.3s ease;
}

.time-display.pulse {
    animation: pulseEffect 1s infinite alternate;
}

@keyframes pulseEffect {
    from { color: var(--rust); }
    to { color: var(--xanthous); }
}

.mode-status {
    font-size: 1.3em;
    margin-bottom: 25px;
    color: var(--russet);
    font-family: 'Pixelify Sans', cursive;
}

.duration-selector,
.break-selector {
    margin: 15px 0;
}

.duration-selector label,
.break-selector label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--black-bean);
    font-size: 1.1em;
}

.duration-buttons,
.break-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.duration-btn,
.break-btn {
    background-color: var(--xanthous);
    color: var(--black-bean);
    border: 2px solid var(--butterscotch);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-family: 'Pixelify Sans', cursive;
    transition: background-color 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

.duration-btn:hover,
.break-btn:hover {
    background-color: var(--butterscotch);
    transform: translateY(-2px);
    border-color: var(--rust);
}

.duration-btn.active,
.break-btn.active {
    background-color: var(--rust);
    color: var(--white);
    border-color: var(--black-bean);
    font-weight: bold;
}

.progress-container {
    height: 15px;
    background-color: var(--russet);
    border-radius: 8px;
    overflow: hidden;
    margin: 25px 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--xanthous);
    border-radius: 8px;
    transition: width 1s linear;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

.control-btn {
    background-color: var(--rust);
    color: var(--white);
    border: 2px solid var(--russet);
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Pixelify Sans', cursive;
    font-size: 1.2em;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.control-btn:hover {
    background-color: var(--butterscotch);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.control-btn.paused {
    background-color: var(--butterscotch);
    border-color: var(--xanthous);
}

.session-info {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    font-size: 1.1em;
    color: var(--black-bean);
    font-weight: bold;
}

.session-counter,
.completed-counter {
    background-color: var(--xanthous);
    padding: 8px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* --- Notification Styling --- */
.notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--rust);
    color: var(--white);
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out, transform 0.4s ease-out;
    z-index: 1002;
}

.notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

.notification-icon {
    font-size: 1.8em;
}

.notification-text {
    font-family: 'Lora', serif;
    font-size: 1.1em;
    flex-grow: 1;
}

.notification-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.notification-close:hover {
    transform: rotate(90deg);
}


/* --- General Animations --- */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}


/* --- Responsive Design --- */

/* For Tablets and smaller desktops (e.g., up to 1024px) */
@media (max-width: 1024px) {
    .overlay-text {
        font-size: 3.5em;
        top: 60px;
    }
    .overlay-text-bottom {
        font-size: 2em;
        bottom: 30%;
    }
    .room-selection-buttons {
        bottom: 15%;
        gap: 30px; /* Slightly reduced gap for tablets */
    }
    .room-btn {
        padding: 12px 25px;
        font-size: 1.1em;
    }
    .top-buttons {
        gap: 15px;
        top: 25px;
        right: 25px;
    }
    .top-btn {
        padding: 10px 20px;
        font-size: 1em;
    }
    .dropdown-content {
        min-width: 140px;
    }
    .dropdown-content a {
        padding: 10px 14px;
        font-size: 0.9em;
    }

    /* Pomodoro Timer Responsive */
    .timer-popup {
        width: 320px;
        padding: 25px 30px;
    }
    .popup-title {
        font-size: 1.6em;
    }
    .time-display {
        font-size: 4em;
    }
    .mode-status {
        font-size: 1.1em;
    }
    .control-btn {
        padding: 10px 20px;
        font-size: 1.1em;
    }
    .circle-btn {
        width: 120px;
        height: 120px;
        font-size: 1.2em;
    }
    .main-buttons {
        gap: 30px;
    }
}

/* For Mobile Phones (e.g., up to 768px) */
@media (max-width: 768px) {
    .overlay-text {
        font-size: 2.5em;
        padding: 0 15px;
        white-space: normal;
        width: 90%;
        top: 50px;
    }
    .overlay-text-bottom {
        font-size: 1.8em;
        padding: 0 15px;
        white-space: normal;
        width: 90%;
        bottom: 25%;
    }
    .room-selection-buttons {
        flex-direction: column; /* Re-enable stacking for smaller screens */
        bottom: 15%;
        gap: 10px;
        width: calc(100% - 40px);
        left: 50%;
        transform: translateX(-50%);
        max-width: 250px; /* Constrain width when stacked */
        white-space: normal; /* Allow text to wrap if necessary */
    }
    .room-btn {
        width: 100%; /* Take full available width when stacked */
        max-width: 250px; /* But don't exceed a reasonable max */
        padding: 10px 20px;
        font-size: 1em;
    }

    .top-buttons {
        flex-direction: column; /* Stack buttons vertically */
        top: 20px;
        right: 20px;
        left: 20px;
        width: calc(100% - 40px);
        align-items: flex-end; /* Align to the right */
        gap: 10px;
    }
    .top-btn {
        width: auto;
        max-width: 180px; /* Maintain a max-width for stacked buttons */
        padding: 10px 15px;
        font-size: 0.9em;
        text-align: center;
        width: 100%; /* Make them fill available width when stacked */
    }
    /* Fixed dropdown for mobile vertical stacking */
    .dropdown {
        width: 100%; /* Take full width in column layout */
    }
    .dropdown-content {
        position: static; /* Remove absolute positioning when stacked */
        transform: none; /* Remove transform */
        width: 100%; /* Take full width */
        box-shadow: none; /* Remove shadow to blend better */
        border-top: 1px solid rgba(255,255,255,0.1); /* Add a separator */
        border-radius: 0 0 8px 8px; /* Round bottom corners */
    }
    .dropdown:hover .dropdown-content {
        transform: none; /* Reset transform on hover */
    }


    /* Pomodoro Timer Responsive */
    .timer-popup {
        width: 280px;
        padding: 20px 25px;
    }
    .popup-title {
        font-size: 1.4em;
    }
    .time-display {
        font-size: 3.5em;
    }
    .mode-status {
        font-size: 1em;
    }
    .duration-btn,
    .break-btn,
    .control-btn {
        font-size: 0.9em;
        padding: 8px 15px;
    }
    .circle-btn {
        width: 100px;
        height: 100px;
        font-size: 1em;
    }
    .main-buttons {
        gap: 20px;
    }
    .notification {
        width: calc(100% - 60px);
        padding: 12px 20px;
        font-size: 0.9em;
    }
}

/* --- Spotify Popup Styling --- */
.spotify-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(60, 20, 10, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spotify-overlay.active {
    display: flex;
    opacity: 1;
}

.spotify-popup {
    background-color: var(--soft-off-white);
    border: 4px solid var(--butterscotch);
    border-radius: 20px;
    padding: 30px 40px;
    width: 600px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
    font-family: 'Lora', serif;
    color: var(--black-bean);
    text-align: center;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.spotify-overlay.active .spotify-popup {
    transform: scale(1);
    opacity: 1;
}

/* Duplicated from .timer-popup, consider consolidating if possible for .popup-header, .popup-title, .close-btn */
/* .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.popup-title {
    margin: 0;
    font-size: 2em;
    color: var(--rust);
    font-family: 'Pixelify Sans', cursive;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--russet);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.2) rotate(90deg);
    color: var(--butterscotch);
} */

.spotify-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.playlist-section h3 {
    font-size: 1.4em;
    color: var(--rust);
    margin-bottom: 15px;
    font-family: 'Pixelify Sans', cursive;
}

.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

#playlist-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid var(--butterscotch);
    border-radius: 10px;
    background-color: var(--white);
    color: var(--black-bean);
    font-family: 'Lora', serif;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#playlist-input:focus {
    border-color: var(--rust);
    box-shadow: 0 0 8px rgba(178, 74, 6, 0.3);
}

#playlist-input::placeholder {
    color: rgba(60, 20, 10, 0.6);
    font-style: italic;
}

.embed-btn {
    background-color: var(--rust);
    color: var(--white);
    border: 2px solid var(--russet);
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Pixelify Sans', cursive;
    font-size: 1em;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    white-space: nowrap;
}

.embed-btn:hover {
    background-color: var(--butterscotch);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.playlist-container {
    min-height: 400px;
    background-color: rgba(249, 193, 80, 0.1);
    border: 2px dashed var(--butterscotch);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.default-message {
    text-align: center;
    color: var(--russet);
}

.music-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.default-message p {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--black-bean);
}

.default-message small {
    color: var(--russet);
    font-style: italic;
}

.spotify-player {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.player-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.refresh-btn,
.clear-btn {
    background-color: var(--xanthous);
    color: var(--black-bean);
    border: 2px solid var(--butterscotch);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Pixelify Sans', cursive;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.refresh-btn:hover,
.clear-btn:hover {
    background-color: var(--butterscotch);
    transform: translateY(-2px);
}

.clear-btn {
    background-color: var(--russet);
    color: var(--white);
    border-color: var(--black-bean);
}

.clear-btn:hover {
    background-color: var(--rust);
}

.error-message {
    text-align: center;
    padding: 20px;
}

.error-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.error-message p {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.error-message small {
    color: var(--russet);
    font-style: italic;
}

/* --- Responsive Design for Spotify Popup --- */
@media (max-width: 768px) {
    .spotify-popup {
        width: 350px;
        padding: 25px 30px;
    }
    
    .popup-title {
        font-size: 1.6em;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    #playlist-input {
        min-width: auto;
        width: 100%;
    }
    
    .embed-btn {
        width: 100%;
        padding: 15px 20px;
    }
    
    .playlist-container {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .spotify-popup {
        width: 280px;
        padding: 20px 25px;
    }
    
    .popup-title {
        font-size: 1.4em;
    }
    
    .playlist-section h3 {
        font-size: 1.2em;
    }
    
    .music-icon {
        font-size: 3em;
    }
    
    .default-message p {
        font-size: 1em;
    }
}

/* For very small phones (e.g., up to 480px) */
@media (max-width: 480px) {
    .overlay-text {
        font-size: 1.8em;
        top: 30px;
    }
    .overlay-text-bottom {
        font-size: 1.4em;
        bottom: 20%;
    }
    .room-selection-buttons {
        bottom: 10%;
        /* Re-evaluate if you want them always stacked on small screens or try to keep them inline */
        flex-direction: column; /* Keep stacked on small screens for better UX */
        max-width: 220px; /* Adjust max-width for very small screens */
    }
    .room-btn {
        font-size: 0.9em;
        padding: 8px 15px;
        max-width: 220px; /* Ensure consistency */
    }
    .top-buttons {
        right: 15px;
        left: 15px;
        width: calc(100% - 30px);
    }
    .top-btn {
        font-size: 0.8em;
        padding: 8px 12px;
    }
    /* Pomodoro Timer Responsive */
    .timer-popup {
        width: 240px;
        padding: 15px 20px;
    }
    .time-display {
        font-size: 3em;
    }
    .duration-buttons,
    .break-buttons,
    .timer-controls {
        flex-direction: column;
        gap: 8px;
    }
    .duration-btn,
    .break-btn,
    .control-btn {
        width: 100%;
        max-width: 180px;
        margin: 0 auto;
    }
    .circle-btn {
        width: 80px;
        height: 80px;
        font-size: 0.8em;
    }
    .main-buttons {
        gap: 15px;
    }
}

/* --- ToDo Popup Styling (NEW) --- */
.todo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(60, 20, 10, 0.95); /* Consistent with other overlays */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.todo-overlay.active {
    display: flex;
    opacity: 1;
}

.todo-popup {
    background-color: var(--soft-off-white);
    border: 4px solid var(--butterscotch);
    border-radius: 20px;
    padding: 30px 40px;
    width: 550px;
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
    color: var(--black-bean);
    text-align: left;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

.todo-overlay.active .todo-popup {
    transform: scale(1);
    opacity: 1;
}

.todo-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto; /* Allow content to scroll if it overflows */
}

/* Input Section */
.todo-input-section {
    background-color: rgba(137, 70, 25, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(137, 70, 25, 0.2);
}

.todo-input-section .input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#todoInput {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--butterscotch);
    border-radius: 10px;
    background-color: var(--white);
    color: var(--black-bean);
    font-family: 'Lora', serif;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#todoInput:focus {
    border-color: var(--rust);
    box-shadow: 0 0 8px rgba(178, 74, 6, 0.3);
}

.add-btn {
    background-color: var(--rust);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Pixelify Sans', cursive;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.add-btn:hover {
    background-color: var(--butterscotch);
    transform: translateY(-2px);
}

.priority-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Pixelify Sans', cursive;
    color: var(--russet);
}

#prioritySelect {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid var(--butterscotch);
    background-color: var(--white);
    font-family: 'Lora', serif;
    font-size: 0.9em;
    outline: none;
}

/* Stats Section */
.todo-stats {
    display: flex;
    justify-content: space-around;
    background-color: rgba(249, 193, 80, 0.1);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.stat-item {
    font-family: 'Pixelify Sans', cursive;
}

.stat-number {
    display: block;
    font-size: 1.8em;
    color: var(--rust);
    font-weight: bold;
}

.stat-label {
    font-size: 0.9em;
    color: var(--russet);
}

/* Filters Section */
.todo-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: transparent;
    color: var(--russet);
    border: 2px solid var(--butterscotch);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Pixelify Sans', cursive;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: rgba(213, 137, 43, 0.2);
    border-color: var(--rust);
    color: var(--rust);
}

.filter-btn.active {
    background-color: var(--rust);
    color: var(--white);
    border-color: var(--rust);
    font-weight: bold;
}

/* List Section */
.todo-list-container {
    background-color: var(--white);
    border-radius: 12px;
    padding: 10px;
    min-height: 200px;
    max-height: 30vh; /* Control max height */
    overflow-y: auto;
    border: 1px solid rgba(0,0,0,0.1);
}

.todo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 180px;
    text-align: center;
    color: var(--russet);
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 3em;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

/* ToDo Item */
.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid rgba(137, 70, 25, 0.1);
    transition: background-color 0.2s ease;
}

.todo-item:last-child {
    border-bottom: none;
}

.todo-item:hover {
    background-color: rgba(249, 193, 80, 0.1);
}

.todo-checkbox {
    cursor: pointer;
    min-width: 18px;
    height: 18px;
}

.todo-task {
    flex-grow: 1;
    font-family: 'Lora', serif;
    font-size: 1em;
    color: var(--black-bean);
    transition: all 0.3s ease;
}

.todo-item.completed .todo-task {
    text-decoration: line-through;
    opacity: 0.5;
}

.todo-priority {
    font-family: 'Pixelify Sans', cursive;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    white-space: nowrap;
}

.priority-high {
    background-color: rgba(178, 74, 6, 0.2);
    color: var(--rust);
}
.priority-medium {
    background-color: rgba(213, 137, 43, 0.2);
    color: var(--butterscotch);
}
.priority-low {
    background-color: rgba(137, 70, 25, 0.2);
    color: var(--russet);
}

.todo-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.todo-delete:hover {
    opacity: 1;
    color: #c0392b;
    transform: scale(1.2);
}

/* Actions Section */
.todo-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px dashed rgba(137, 70, 25, 0.2);
}

.action-btn {
    flex-grow: 1;
    background-color: var(--xanthous);
    color: var(--black-bean);
    border: 2px solid var(--butterscotch);
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Pixelify Sans', cursive;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.clear-all-btn {
    background-color: var(--russet);
    color: var(--white);
    border-color: var(--black-bean);
}

.clear-all-btn:hover {
    background-color: var(--rust);
}

/* Responsive Styles for ToDo Popup */
@media (max-width: 768px) {
    .todo-popup {
        padding: 25px;
    }
    .stat-number {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .todo-popup {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }
    .todo-input-section .input-container {
        flex-direction: column;
    }
    .add-btn {
        width: 100%;
    }
    .todo-stats {
        padding: 10px;
    }
}