/* study-room.css */

/* Full-Screen Reset */
body.study-room-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    font-family: 'Nunito', 'Noto Sans JP', 'Zen Maru Gothic', sans-serif;
    user-select: none;
}

/* Main Wrapper */
.study-room-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-size: 200% 200%;
    animation: gradientAnimation 25s ease infinite;
    transition: background 0.8s ease, color 0.5s ease;
    z-index: 1;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Themes */
.bg-sakura {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 50%, #fbcfe8 100%);
    color: #4c0519;
}
.bg-lofi-night {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #311042 100%);
    color: #e2e8f0;
}
.bg-library {
    background: linear-gradient(135deg, #fdf8e2 0%, #fef3c7 50%, #f59e0b 100%);
    color: #451a03;
}
.bg-classroom {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%);
    color: #064e3b;
}
.bg-fuji {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #bae6fd 100%);
    color: #0c4a6e;
}
.bg-rainy-window {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 50%, #94a3b8 100%);
    color: #0f172a;
}
.bg-minimal-cream {
    background: linear-gradient(135deg, #fafaf9 0%, #f5f5f4 50%, #e7e5e4 100%);
    color: #292524;
}

/* Glassmorphism Panel base */
.glass-panel {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    transition: all 0.3s ease;
}

.bg-lofi-night .glass-panel {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Top Bar */
.study-top-bar {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 100;
}
.bg-lofi-night .study-top-bar {
    background: rgba(15, 23, 42, 0.4);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.study-top-left, .study-top-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-back-home {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.btn-back-home:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateX(-3px);
    color: inherit;
}
.bg-lofi-night .btn-back-home {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.05);
}
.bg-lofi-night .btn-back-home:hover {
    background: rgba(255, 255, 255, 0.2);
}

.room-title {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-weight: 900;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.study-top-badge {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 6px 14px;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.bg-lofi-night .study-top-badge {
    background: rgba(255, 255, 255, 0.1);
}

/* Left Vertical Floating Toolbar */
.study-left-toolbar {
    position: absolute;
    top: 95px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    z-index: 90;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}
.bg-lofi-night .study-left-toolbar {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
}

.toolbar-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: none;
    background: transparent;
    font-size: 1.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: inherit;
    position: relative;
}
.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}
.bg-lofi-night .toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Tooltip */
.toolbar-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 65px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    transform: translateX(-10px);
}
.toolbar-btn:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Center Layout Area */
.study-center-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    z-index: 50;
}

.timer-card {
    width: 100%;
    max-width: 450px;
    text-align: center;
    padding: 24px 20px;
}

.study-badge {
    background: rgba(255, 255, 255, 0.8);
    color: #e11d48;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-radius: 999px;
    padding: 4px 12px;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    margin-bottom: 12px;
}
.bg-lofi-night .study-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #f43f5e;
}

/* Timer Display */
.timer-display {
    font-size: 5.2rem;
    font-weight: 900;
    font-family: 'Zen Maru Gothic', 'Noto Sans JP', sans-serif;
    letter-spacing: -2px;
    text-align: center;
    line-height: 1.0;
    margin: 10px 0 15px 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Progress bar container */
.study-progress {
    height: 10px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 20px;
}
.bg-lofi-night .study-progress {
    background: rgba(255, 255, 255, 0.1);
}

.study-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899, #f43f5e);
    width: 0%;
    transition: width 1s linear;
    border-radius: 999px;
}

/* Plant visualization */
.plant-box {
    text-align: center;
    padding: 10px 0;
    margin-bottom: 20px;
    position: relative;
}

.plant-emoji {
    font-size: 4.2rem;
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.plant-emoji.grow-animation {
    animation: growPulse 0.8s ease-out;
}

@keyframes growPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.plant-status {
    font-weight: 800;
    font-size: 1.05rem;
    margin-top: 5px;
}

/* Timer Action Controls */
.timer-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.timer-control-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}
.timer-control-btn.btn-play {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    color: white;
    width: 68px;
    height: 68px;
    font-size: 1.8rem;
}
.timer-control-btn.btn-play:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}
.timer-control-btn.btn-secondary-action {
    background: rgba(255, 255, 255, 0.6);
    color: inherit;
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
}
.timer-control-btn.btn-secondary-action:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.08);
}
.bg-lofi-night .timer-control-btn.btn-secondary-action {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}
.bg-lofi-night .timer-control-btn.btn-secondary-action:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Quotes */
.quote-box {
    margin-top: 15px;
    min-height: 45px;
}
.quote-jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    opacity: 0.8;
}
.quote-vi {
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.7;
}

/* Sliding Drawers */
.sliding-drawer {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 390px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.sliding-drawer.drawer-left {
    left: 0;
    transform: translateX(-100%);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}
.sliding-drawer.drawer-right {
    right: 0;
    transform: translateX(100%);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}
.sliding-drawer.open {
    transform: translateX(0);
}
.bg-lofi-night .sliding-drawer {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
}

.drawer-header {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.bg-lofi-night .drawer-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.drawer-title {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 1.3rem;
    font-weight: 900;
    margin: 0;
}

.drawer-close-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.drawer-close-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(90deg);
}
.bg-lofi-night .drawer-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Tabs inside Drawer */
.drawer-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0 15px;
}
.bg-lofi-night .drawer-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.drawer-tab {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.6;
}
.drawer-tab.active {
    border-bottom-color: #f43f5e;
    opacity: 1;
    color: #f43f5e;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.drawer-pane {
    display: none;
}
.drawer-pane.active {
    display: block;
}

/* Leaderboard Styling */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    transition: all 0.2s ease;
}
.bg-lofi-night .leaderboard-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}
.leaderboard-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(244, 63, 94, 0.3);
}
.bg-lofi-night .leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 850;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.05);
}
.rank-badge.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.35);
}
.rank-badge.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a9a9a9);
    color: white;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.35);
}
.rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    color: white;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.35);
}

.leaderboard-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f43f5e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.15);
}
.leaderboard-info {
    flex: 1;
    min-width: 0;
}
.leaderboard-name {
    font-weight: 800;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.leaderboard-email {
    font-size: 0.75rem;
    opacity: 0.65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.leaderboard-time {
    font-weight: 900;
    font-size: 0.95rem;
    color: #f43f5e;
    white-space: nowrap;
}

/* Playlist / Track Items */
.playlist-track-item {
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}
.bg-lofi-night .playlist-track-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}
.playlist-track-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.55);
    border-color: #f43f5e;
}
.bg-lofi-night .playlist-track-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #f43f5e;
}

.track-info {
    flex: 1;
    padding-right: 10px;
}
.track-title {
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 2px;
}
.track-artist {
    font-size: 0.75rem;
    opacity: 0.7;
}
.track-duration {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 800;
}

/* Form Soft Controls */
.form-soft-select, .form-soft-control {
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    font-weight: 700;
    color: inherit;
    padding: 10px 14px;
    transition: all 0.2s ease;
}
.bg-lofi-night .form-soft-select, .bg-lofi-night .form-soft-control {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e2e8f0 !important;
}
.bg-lofi-night .form-soft-select option {
    background: #1e1b4b; /* solid dark background for options dropdown */
    color: #e2e8f0;
}
.bg-lofi-night .form-soft-control::placeholder {
    color: rgba(226, 232, 240, 0.4) !important;
}
.form-soft-select:focus, .form-soft-control:focus {
    background: #fff;
    border-color: #f43f5e;
    outline: none;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.15);
}
.bg-lofi-night .form-soft-select:focus, .bg-lofi-night .form-soft-control:focus {
    background: rgba(15, 23, 42, 0.9);
}

/* Study Option Buttons */
.btn-study-option {
    background: rgba(255, 255, 255, 0.45);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    color: inherit;
    font-weight: 800;
    border-radius: 12px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}
.btn-study-option:hover {
    background: rgba(255, 255, 255, 0.75);
    color: inherit;
}
.btn-study-option.active {
    background: #f43f5e;
    color: white !important;
    border-color: #f43f5e;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
}
.bg-lofi-night .btn-study-option {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(226, 232, 240, 0.6);
}
.bg-lofi-night .btn-study-option:hover {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}
.bg-lofi-night .btn-study-option.active {
    background: #f43f5e;
    color: white !important;
    border-color: #f43f5e;
}

/* Youtube Embed & Mini widget */
.youtube-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
}
.youtube-placeholder {
    padding: 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    border: 2px dashed rgba(0, 0, 0, 0.08);
}
.bg-lofi-night .youtube-placeholder {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Mini Controller Widget */
.mini-youtube-controller {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    width: 100%;
    max-width: 450px;
}
.bg-lofi-night .mini-youtube-controller {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

.mini-track-icon {
    font-size: 1.5rem;
    animation: rotateDisc 10s linear infinite;
    animation-play-state: paused;
}
.mini-track-icon.playing {
    animation-play-state: running;
}
@keyframes rotateDisc {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mini-track-details {
    flex: 1;
    min-width: 0;
    text-align: left;
}
.mini-track-title {
    font-weight: 800;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-track-status {
    font-size: 0.75rem;
    opacity: 0.7;
}

.mini-track-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mini-track-btn {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: inherit;
    transition: transform 0.1s ease;
}
.mini-track-btn:active {
    transform: scale(0.9);
}

/* History lists */
.session-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.session-item {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}
.bg-lofi-night .session-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}
.session-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.5);
}

.session-badge-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-radius: 99px;
    padding: 4px 10px;
    font-weight: 800;
    font-size: 0.75rem;
}
.session-badge-cancelled {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-radius: 99px;
    padding: 4px 10px;
    font-weight: 800;
    font-size: 0.75rem;
}

/* General button premium */
.btn-premium-pink {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    color: #ffffff;
    border: none;
    border-radius: 99px;
    font-weight: 800;
    padding: 10px 24px;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.25);
    transition: all 0.2s ease;
}
.btn-premium-pink:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.35);
    color: #fff;
}
.btn-premium-pink:active {
    transform: translateY(0);
}

.btn-delete-track {
    font-size: 1.15rem;
    padding: 2px 8px;
    border-radius: 8px;
    transition: background 0.2s, transform 0.1s;
    opacity: 0.7;
}
.btn-delete-track:hover {
    background: rgba(220, 53, 69, 0.12);
    transform: scale(1.1);
    opacity: 1;
}
.btn-delete-track:active {
    transform: scale(0.9);
}

/* Custom Alert and Confirm Modals */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: all;
}
.custom-modal-overlay.show {
    opacity: 1;
}
.custom-modal-card {
    width: 92%;
    max-width: 410px;
    padding: 30px;
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 28px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}
.custom-modal-overlay.show .custom-modal-card {
    transform: scale(1);
}
.custom-modal-overlay.bg-lofi-night .custom-modal-card {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

/* Background YouTube play style to bypass browser d-none throttling */
.youtube-audio-only {
    position: absolute;
    width: 1px;
    height: 1px;
    left: -9999px;
    top: -9999px;
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
    .study-room-wrapper {
        font-size: 14px;
    }

    .glass-panel {
        padding: 16px;
        border-radius: 18px;
    }

    .custom-modal-card {
        padding: 24px;
        border-radius: 22px;
        max-width: 340px;
    }

    .timer-display {
        font-size: clamp(3rem, 12vw, 5rem);
    }

    .study-controls {
        gap: 8px;
    }

    .study-control-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .settings-panel {
        padding: 16px;
        border-radius: 18px;
    }
}

@media (max-width: 430px) {
    .study-room-wrapper {
        font-size: 13px;
    }

    .glass-panel {
        padding: 12px;
        border-radius: 14px;
    }

    .timer-display {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .study-control-btn {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

.youtube-audio-only {
    opacity: 0;
    pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   EXPLICIT LIGHT & DARK MODE OVERRIDES (STUDY ROOM)
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── Light Mode ─── */
[data-theme="light"] .glass-panel,
:root:not([data-theme="dark"]) .glass-panel {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(15, 23, 42, 0.09) !important;
    color: #0f172a !important;
}

[data-theme="light"] .timer-display,
:root:not([data-theme="dark"]) .timer-display {
    color: #0f172a !important;
}

[data-theme="light"] .study-control-btn,
:root:not([data-theme="dark"]) .study-control-btn {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    color: #334155 !important;
}

[data-theme="light"] .study-control-btn:hover,
:root:not([data-theme="dark"]) .study-control-btn:hover {
    background: #ecfdf5 !important;
    color: #059669 !important;
    border-color: #10b981 !important;
}

/* ─── Dark Mode ─── */
[data-theme="dark"] .glass-panel,
html.dark .glass-panel {
    background: rgba(22, 29, 43, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .timer-display,
html.dark .timer-display {
    color: #f8fafc !important;
}

[data-theme="dark"] .study-control-btn,
html.dark .study-control-btn {
    background: #161d2b !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .study-control-btn:hover,
html.dark .study-control-btn:hover {
    background: #10b981 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
}
