:root {
    --gradient-start: #ff9966;
    --gradient-end: #ff5e62;
    --primary-accent: #007bff;
    --primary-accent-hover: #0056b3;
    --secondary-accent: #ff5e62;
    --secondary-accent-hover: #ff4b4f;
    --container-bg: #f8f9fa;
    --container-bg-alt: #ffffff;
    --text-light: white;
    --text-dark: #343a40;
    --text-medium: #6c757d;
    --text-subtle: #adb5bd;
    --text-link: var(--primary-accent);
    --success-green: #28a745;
    --success-green-hover: #218838;
    --danger-red: #dc3545;
    --danger-red-hover: #c82333;
    --warning-yellow: #ffc107;
    --info-blue: #17a2b8;
    --accent-pink: #e83e8c;
    --accent-pink-hover: #d81b60;
    --stat-bg: #e9ecef;
    --border-light: #dee2e6;
    --border-medium: #ced4da;
    --border-dark: #adb5bd;
    --token-bg-start: #fde047;
    --token-bg-end: #facc15;
    --token-text: #78350f;
    --token-border: #fef08a;
    --token-increase-bg-start: #a7f3d0;
    --token-increase-bg-end: #6ee7b7;
    --token-increase-text: #064e3b;
    --token-decrease-bg-start: #fecaca;
    --token-decrease-bg-end: #fca5a5;
    --token-decrease-text: #7f1d1d;
    --speech-bubble-bg: #e0f2fe;
    --speech-bubble-border: #7dd3fc;
    --speech-bubble-text: #075985;
    --simple-pomodoro-overlay-bg: rgba(220, 53, 69, 0.95);
    --pomodoro-confirm-bg: rgba(255, 255, 255, 0.9);
    --planner-bg-color: var(--container-bg);
    --planner-container-bg: var(--container-bg-alt);
    --planner-primary-color: var(--primary-accent);
    --planner-secondary-color: var(--info-blue);
    --planner-accent-color: var(--warning-yellow);
    --planner-text-color: var(--text-dark);
    --planner-border-color: var(--border-light);
    --planner-shadow-color: rgba(0,0,0,0.1);
    --planner-error-color: var(--danger-red);
    --planner-loading-color: var(--text-medium);
    --planner-delete-color: var(--danger-red);
    --planner-resize-handle-color: var(--primary-accent);
    --planner-task-color-1: #e9f5f5;
    --planner-task-color-1-border: #94d2bd;
    --planner-task-color-2: #fff3e0;
    --planner-task-color-2-border: #ffb703;
    --planner-task-color-3: #e6f0ff;
    --planner-task-color-3-border: #a8c8f0;
    --planner-task-color-break: #f8f9fa;
    --planner-task-color-break-border: #adb5bd;
    --planner-task-color-default: #e9ecef;
    --planner-task-color-default-border: #ced4da;
    --priority-star-inactive: var(--text-medium);
    --priority-star-gradient-start: #FFD700; /* Gold for star */
    --priority-star-gradient-end: #B8860B;   /* DarkGoldenRod for star */
    --priority-task-gradient-start: #e6e6fa; /* Lavender - light purple */
    --priority-task-gradient-end: #d8bfd8;   /* Thistle - slightly darker purple */
    --current-time-indicator-color: red;
    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 12px;
    --radius-round: 50px;
    --shadow-light: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-large: 0 6px 18px rgba(0, 0, 0, 0.15);
    --shadow-inset: inset 0 1px 2px rgba(0,0,0,0.075);
    --shadow-text-light: 1px 1px 2px rgba(0,0,0,0.2);
    --shadow-text-dark: 1px 1px 3px rgba(0, 0, 0, 0.3);
    --header-height: 70px;
    --overlay-bg: rgba(0, 0, 0, 0.65);
    --sidebar-width-collapsed: 80px;
    --sidebar-width-expanded: 200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to bottom, #E6E9FF, #D4D0FF);
    color: var(--text-dark);
    margin: 0;
    font-size: 16px;
    min-height: 100vh;
    transition: overflow 0.3s ease;
}
body.has-sidebar {
    padding-top: 0;
}
body:not(.has-sidebar) {
    padding-top: var(--header-height);
}

body.modal-open {
    overflow: hidden;
}
body.login-page { padding-top: 0; display: flex; justify-content: center; align-items: center; }

h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--text-dark); margin-bottom: 0.75rem; }
h1 { font-size: 2.5em; text-shadow: var(--shadow-text-light); }
h2 { font-size: 1.75em; }
h3 { font-size: 1.25em; }
h4 { font-size: 1.05em; margin-bottom: 0.5rem; font-weight: 500; }
p { margin-bottom: 1rem; color: var(--text-medium); line-height: 1.6; }
a { color: var(--text-link); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-accent-hover); text-decoration: underline; }
.text { font-size: 0.9em; font-weight: 400; color: var(--text-medium); }

.header { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 2rem; background-color: var(--container-bg-alt); box-shadow: var(--shadow-medium); position: fixed; top: 0; left: 0; z-index: 1000; height: var(--header-height); border-bottom: 1px solid var(--border-light); }
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.header-logo {
    height: 35px;
    width: auto;
    margin-right: 0.25rem;
}
.hamburger-button { display: flex; flex-direction: column; justify-content: space-around; width: 28px; height: 22px; background: none; border: none; cursor: pointer; padding: 0; z-index: 1051; }
.hamburger-button span { display: block; width: 100%; height: 3px; background-color: var(--text-dark); border-radius: 3px; transition: all 0.3s ease-in-out; }
.header h1 { margin: 0; font-size: 1.8em; color: var(--text-dark); text-shadow: none; }
.user-profile { display: flex; align-items: center; gap: 1rem; }
.user-profile img#profile-image { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary-accent); }
#username-display { font-size: 1em; color: var(--text-dark); font-weight: 500; white-space: nowrap; }
.user-profile button { padding: 0.4rem 0.9rem; border: none; border-radius: var(--radius-small); background-color: var(--primary-accent); color: white; cursor: pointer; font-size: 0.85em; font-weight: 500; line-height: 1.5; white-space: nowrap; font-family: inherit;}
.user-profile button:hover { background-color: var(--primary-accent-hover); transform: translateY(-1px); }
#logout-button { background-color: var(--danger-red); }
#logout-button:hover { background-color: var(--danger-red-hover); }
.guest-profile { display: flex; align-items: center; gap: 0.8rem; }
.header-auth-button { padding: 0.4rem 1rem; border-radius: var(--radius-small); font-size: 0.9em; font-weight: 600; cursor: pointer; border: 1px solid transparent; font-family: inherit;}
.header-auth-button { background-color: var(--primary-accent); color: white; border-color: var(--primary-accent); }
.header-auth-button:hover { background-color: var(--primary-accent-hover); border-color: var(--primary-accent-hover); }
.header-auth-button.secondary { background-color: transparent; color: var(--primary-accent); border-color: var(--primary-accent); }
.header-auth-button.secondary:hover { background-color: rgba(0, 123, 255, 0.1); color: var(--primary-accent-hover); border-color: var(--primary-accent-hover); }
body.uses-custom-header .header { display: none !important; }

body.login-page .header { position: static; box-shadow: none; background-color: transparent; margin-bottom: 20px; border-bottom: none; }
body.login-page .header h1 { color: white; text-shadow: var(--shadow-text-dark); }
body.login-page .header-left { justify-content: center; width: 100%; }

.login-title {
    text-align: center;
}

.auth-form .form-group input[type="email"],
.auth-form .form-group input[type="password"],
.auth-form .form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-medium);
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--container-bg-alt);
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.075);
    margin-bottom: 1rem;
}

.auth-form .form-group input[type="email"]:focus,
.auth-form .form-group input[type="password"]:focus,
.auth-form .form-group input[type="text"]:focus {
    border-color: var(--primary-accent);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.auth-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-medium);
}

.auth-form .form-group input::placeholder {
    color: var(--text-subtle);
    font-style: italic;
    font-weight: 400;
}


.nav-menu { position: fixed; top: 0; left: -300px; width: 300px; height: 100vh; background-color: var(--container-bg-alt); box-shadow: 2px 0 10px rgba(0,0,0,0.15); transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1050; overflow-y: auto; display: flex; flex-direction: column; }
.nav-menu.active { left: 0; }
.nav-header { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1rem; border-bottom: 1px solid var(--border-light); flex-shrink: 0; }
.nav-header h2 { margin: 0; font-size: 1.4em; color: var(--text-dark); }
.close-nav { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--text-medium); padding: 0.3rem; line-height: 1; }
.close-nav:hover { color: var(--text-dark); }
.nav-menu .nav-items { list-style: none; padding: 0; margin: 0; flex-grow: 1; }
.nav-menu .nav-items li { border-bottom: 1px solid var(--border-light); }
.nav-menu .nav-item { display: block; padding: 1rem 1.2rem; color: var(--text-dark); text-decoration: none; transition: background-color 0.2s ease, color 0.2s ease; font-weight: 500; font-size: 1.05em; }
.nav-menu .nav-item:hover { background-color: var(--container-bg); color: var(--primary-accent); }
.nav-menu .nav-items li.active { background-color: var(--primary-accent); }
.nav-menu .nav-items li.active .nav-item { color: white; font-weight: 600; }

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    z-index: 1040;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.menu-overlay.active {
    display: block;
    opacity: 1;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-bg);
    z-index: 1070;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background-color: var(--container-bg-alt);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-large);
    z-index: 1080;
    width: auto;
    max-width: 90%;
    height: auto;
    max-height: 85vh;
    opacity: 0;
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
    overflow-y: auto;
    padding: 25px;
    flex-direction: column;
}
.modal.active {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-planner {
    max-width: 500px;
}

.modal-content {
    position: relative;
    background-color: white;
    padding: 2rem 2.5rem;
    width: 100%;
    border-radius: var(--radius-large);
    text-align: left;
    display: flex;
    flex-direction: column;
}

.modal.small-modal {
    max-width: 450px;
}

#pet-customization-modal .modal-content.pet-customize-content {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}
#pet-customize-exit-confirm .modal-content.small-modal {
     max-width: 400px;
}


.modal h3,
.modal .modal-header h2,
.modal-content .modal-header h2 {
    margin-top: 0;
    color: var(--planner-primary-color);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4em;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}
.modal-header h2 { margin-bottom: 0; font-size: 1.6em; }


.modal-body {
    width: 100%;
    box-sizing: border-box;
    flex-grow: 1;
    overflow-y: auto;
}

.modal p { color: var(--text-dark); line-height: 1.6; margin-bottom: 15px; }
.modal p:last-of-type { margin-bottom: 20px; }


.modal .modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}
.modal .modal-buttons button { padding: 10px 20px; border: none; border-radius: var(--radius-small); font-weight: 600; cursor: pointer; transition: background-color 0.2s ease, box-shadow 0.2s ease; font-family: inherit; font-size: 0.95em; }
.modal .modal-buttons button.secondary { background-color: #e9ecef; color: var(--text-dark); border: 1px solid var(--border-medium); }
.modal .modal-buttons button.secondary:hover { background-color: #dee2e6; border-color: var(--border-dark); }
.modal .modal-buttons button.danger { background-color: var(--danger-red); color: white; }
.modal .modal-buttons button.danger:hover { background-color: var(--danger-red-hover); box-shadow: 0 2px 8px rgba(220,53,69,0.3); }
.modal .modal-buttons button:not(.secondary):not(.danger) { background-color: var(--planner-primary-color); color: white; }
.modal .modal-buttons button:not(.secondary):not(.danger):hover { background-color: var(--primary-accent-hover); box-shadow: 0 2px 8px rgba(0,123,255,0.3); }


.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: var(--text-medium);
    padding: 0.2rem 0.5rem;
    z-index: 10;
}
.close-button:hover { color: var(--text-dark); }

.prompt-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.prompt-button {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-medium);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    margin-top: 1.5rem;
}

.prompt-button.primary {
    background-color: var(--success-green);
    color: white;
    border-color: var(--success-green);
}

.prompt-button.primary:hover {
    background-color: darkgreen;
    border-color: darkgreen;
}

.prompt-button.secondary {
    background-color: transparent;
    color: var(--text-medium);
    border-color: var(--border-medium);
}

.main-container { display: flex; flex-wrap: wrap; width: 100%; max-width: 1600px; margin: 20px auto; padding: 0 15px; gap: 25px; }
.left-column {
    flex: 2 1 800px;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    background-color: var(--planner-container-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--planner-shadow-color);
    overflow: hidden;
    position: relative;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.right-column { flex: 1 1 400px; min-width: 320px; display: flex; flex-direction: column; gap: 25px; }

.left-column .planner-header {
    background-color: var(--planner-primary-color);
    color: #ffffff;
    padding: 15px 30px;
    border-bottom: 4px solid var(--planner-accent-color);
    border-radius: 12px 12px 0 0;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.left-column .planner-header > h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
    color: white;
    text-align: center;
}
.planner-controls-header-internal {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0px 15px 0px;
    border-bottom: 1px solid var(--planner-border-color);
    margin-bottom: 20px;
    flex-shrink: 0;
}
.planner-controls-header-internal h2 {
    margin: 0;
    font-size: 1.4em;
    color: var(--planner-primary-color);
    font-weight: 600;
}
#planner-controls-toggle-action {
    width: 24px;
    height: 20px;
    z-index: 1;
}
#planner-controls-toggle-action span {
    background-color: var(--text-dark);
    height: 2.5px;
}
#planner-controls-toggle-action.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#planner-controls-toggle-action.active span:nth-child(2) { opacity: 0; }
#planner-controls-toggle-action.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.planner-controls-wrapper {
    transition: opacity 0.3s ease, max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, margin 0.3s ease, visibility 0s linear 0.35s;
    overflow: hidden;
    max-height: 2000px;
    opacity: 1;
    visibility: visible;
    padding: 0 0 20px 0;
    flex-shrink: 0;
}
.planner-controls-wrapper.hidden {
    opacity: 0;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    visibility: hidden;
    border-width: 0 !important;
    transition: opacity 0.25s ease, max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease, margin 0.25s ease, visibility 0s linear 0.35s, border-width 0.35s ease;
}
.schedule-section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0px 10px 0px;
    flex-shrink: 0;
}
.schedule-section-header h2 {
    margin: 0;
    font-size: 1.4em;
    color: var(--planner-primary-color);
    font-weight: 600;
    flex-grow: 1;
    text-align: left;
}
#schedule-section-controls-toggle {
    display: none;
    width: 24px;
    height: 20px;
}
#schedule-section-controls-toggle span {
    background-color: var(--text-dark);
    height: 2.5px;
}
.left-column .planner-main.controls-hidden .schedule-section-header #schedule-section-controls-toggle {
    display: flex;
}
.left-column .planner-main.controls-hidden .schedule-section-header {
    justify-content: center;
    position: relative;
}
.left-column .planner-main.controls-hidden .schedule-section-header h2 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
.left-column .planner-main.controls-hidden .schedule-section-header #schedule-section-controls-toggle {
     position: absolute;
     left: 0;
     top: 50%;
     transform: translateY(-50%);
}

.left-column .planner-main {
    display: flex;
    flex-direction: column;
    padding: 0px 30px 30px 30px;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}
.left-column .planner-main.controls-hidden {
    gap: 0;
}

.left-column .controls-section {
    padding-top: 0;
    flex-shrink: 0;
}
.left-column .input-group { margin-bottom: 20px; }
.left-column .input-group label, .left-column .slider-group > label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--planner-secondary-color); }
.left-column textarea#task-input, .left-column input[type="text"], .left-column input[type="range"] { width: 100%; padding: 10px; border: 1px solid var(--planner-border-color); border-radius: 6px; font-size: 1em; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
.left-column textarea#task-input { min-height: 80px; resize: vertical; }
.left-column .slider-group { margin-bottom: 15px; }
.left-column .slider-label { display: flex; justify-content: space-between; font-size: 0.95em; color: var(--planner-text-color); font-weight: 500; margin-bottom: 5px; }
.left-column .slider-label .slider-value { font-weight: 600; color: var(--planner-primary-color); background-color: #e9ecef; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.left-column .radio-group { margin-bottom: 20px; padding: 10px; border: 1px solid var(--planner-border-color); border-radius: 6px; background-color: var(--planner-bg-color); }
.left-column .radio-group label { display: inline-block; margin-right: 15px; font-weight: 500; color: var(--planner-text-color); cursor: pointer; }
.left-column .radio-group input[type="radio"] { margin-right: 5px; cursor: pointer; }
.left-column .radio-group label:hover { color: var(--planner-primary-color); }
.left-column button#generate-schedule { background-color: var(--planner-accent-color); color: var(--planner-text-color); border: none; padding: 12px 25px; border-radius: 6px; font-size: 1.1em; font-weight: 600; cursor: pointer; transition: background-color 0.3s ease, transform 0.1s ease, opacity 0.3s ease; display: block; width: 100%; margin-top: 25px; font-family: inherit; }
.left-column button#generate-schedule:hover { background-color: #d48800; }
.left-column button#generate-schedule:active { transform: scale(0.98); }
.left-column button#generate-schedule:disabled { background-color: var(--planner-loading-color); cursor: not-allowed; opacity: 0.7; }

.left-column .schedule-section {
    min-width: 400px;
    position: relative;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    flex-grow: 1;
    min-height: 0;
}

.left-column .schedule-info-area {
    position: relative;
    min-height: 30px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.left-column .info-icon { position: absolute; top: 0px; right: 0px; width: 24px; height: 24px; background-color: var(--planner-secondary-color); color: #ffffff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1em; font-weight: bold; cursor: pointer; z-index: 10; transition: background-color 0.2s ease; }
.left-column .info-icon:hover { background-color: var(--planner-primary-color); }

.left-column .schedule-display {
    height: 765px;
    overflow-y: scroll;
    border: 1px solid var(--planner-border-color);
    border-radius: 8px;
    padding: 0;
    background-color: #fdfdfd;
    position: relative;
    flex-grow: 1;
    min-height: 0;

    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.2) transparent;
}

.left-column .schedule-display .current-time-indicator {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--current-time-indicator-color);
    z-index: 25; /* Ensure it's above tasks but below interactions if any */
    pointer-events: none; /* So it doesn't interfere with clicks */
}
.left-column .schedule-display .current-time-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    top: -3px; /* Position the dot slightly above the line */
    width: 8px;
    height: 8px;
    background-color: var(--current-time-indicator-color);
    border-radius: 50%;
}


.left-column .schedule-display::-webkit-scrollbar { width: 8px; height: 8px; }
.left-column .schedule-display::-webkit-scrollbar-track { background: transparent; border-radius: 10px; }
.left-column .schedule-display::-webkit-scrollbar-thumb { background-color: rgba(128, 128, 128, 0.2); border-radius: 10px; border: 2px solid transparent; }
.left-column .schedule-display:hover::-webkit-scrollbar-thumb { background-color: rgba(128, 128, 128, 0.7); }
.left-column .schedule-display:hover::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.05); }
.left-column .schedule-display::-webkit-scrollbar-thumb:hover { background-color: rgba(128, 128, 128, 0.9); }


.left-column button.planner-action-button {
    background-color: var(--planner-secondary-color);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    display: block;
    width: auto;
    margin-top: 20px;
    font-family: inherit;
    flex-shrink: 0;
}
.left-column button#reset-schedule-button.planner-action-button {
    align-self: flex-end;
}

.left-column button.planner-action-button:hover { background-color: var(--planner-primary-color); }
.left-column button.planner-action-button:active { transform: scale(0.98); }
.left-column button.planner-action-button.danger { background-color: var(--danger-red); }
.left-column button.planner-action-button.danger:hover { background-color: var(--danger-red-hover); }

.left-column .time-slot { display: flex; align-items: stretch; min-height: 50px; border-top: 1px solid var(--planner-border-color); }
.left-column .time-slot.is-middle-segment { border-top: none; }
.left-column .schedule-display > .time-slot:first-child { border-top: none; }
.left-column .time { flex-basis: 90px; flex-shrink: 0; font-weight: 600; color: var(--planner-secondary-color); font-size: 0.85em; padding: 5px 10px 5px 0; text-align: right; border-right: 1px solid var(--planner-border-color); background-color: var(--planner-bg-color); display: flex; align-items: center; justify-content: flex-end; }
.left-column .activity { flex-grow: 1; display: flex; align-items: stretch; padding: 0; transition: background-color 0.2s ease; position: relative; min-height: 100%; }
.left-column .activity.drag-over, .left-column .activity.resize-preview { background-color: rgba(0,123,255, 0.1); outline: 2px dashed var(--planner-secondary-color); outline-offset: -2px; z-index: 5; }
.left-column .task-item { flex-grow: 1; padding: 8px 12px; font-size: 0.9em; border: 1px solid transparent; border-left-width: 4px; transition: box-shadow 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, background-image 0.2s ease; min-height: 34px; cursor: default; position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; box-sizing: border-box; background-color: var(--planner-task-color-default); margin-top: 0; margin-bottom: 0; height: 100%; }
.left-column .task-item.completed { opacity: 0.8; background-color: #f1f3f5; background-image: none; }
.left-column .task-item.priority {
    background-image: linear-gradient(to bottom right, var(--priority-task-gradient-start), var(--priority-task-gradient-end));
    border-left-color: var(--priority-task-gradient-end);
    z-index: 2;
}
.left-column .task-segment { border-top: none; border-bottom: none; border-radius: 0; }
.left-column .task-segment-start { border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-top: 1px solid rgba(0,0,0,0.05); padding-top: 8px; padding-bottom: 4px; z-index: 2; }
.left-column .task-segment-start[draggable="true"]:not(.completed) { cursor: grab; }
.left-column .task-segment-start[draggable="true"]:not(.completed):active { cursor: grabbing; }
.left-column .task-segment-start.completed { cursor: default !important; }
.left-column .task-segment-middle { border-radius: 0; padding-top: 4px; padding-bottom: 4px; margin-top: 0; }
.left-column .task-segment-end { border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 8px; padding-top: 4px; margin-top: 0; }
.left-column .task-segment-start.task-segment-end { border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; border-top: 1px solid rgba(0,0,0,0.05); border-bottom: 1px solid rgba(0,0,0,0.05); padding-top: 8px; padding-bottom: 8px; margin-top: 0; }
.left-column .task-segment-start.dragging, .left-column .task-segment.dragging-segment { opacity: 0.4 !important; }
.left-column .task-content { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 24px; }
.left-column .task-item .priority-star { font-size: 1.1em; color: var(--priority-star-inactive); cursor: pointer; z-index: 3; transition: color 0.2s ease, transform 0.1s ease, background 0.2s ease; line-height: 1; padding: 2px; margin-right: 8px; order: 1; }
.left-column .task-item .priority-star.active {
    background: linear-gradient(to bottom right, var(--priority-star-gradient-start), var(--priority-star-gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
.left-column .task-item .priority-star:hover:not(.active) {
    transform: scale(1.15);
    color: var(--priority-star-gradient-start);
}
.left-column .task-segment-start .delete-task { position: absolute; top: -8px; right: -8px; width: 18px; height: 18px; background-color: var(--planner-delete-color); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8em; font-weight: bold; cursor: pointer; z-index: 4; opacity: 0; pointer-events: none; }
.left-column .task-segment-start:not(.completed):hover .delete-task { opacity: 1; pointer-events: auto; }
.left-column .task-segment-start:not(.completed) .delete-task:hover { background-color: #c82333; }
.left-column .task-segment-start .resize-handle { position: absolute; left: 0; right: 0; height: 8px; background-color: transparent; z-index: 2; cursor: ns-resize; opacity: 0; transition: opacity 0.2s ease; border-top: 2px solid var(--planner-resize-handle-color); border-bottom: 2px solid var(--planner-resize-handle-color); pointer-events: none; }
.left-column .task-segment-start:not(.completed):hover .resize-handle { opacity: 1; pointer-events: auto; }
.left-column .task-segment-start .resize-handle.top { top: -4px; }
.left-column .task-segment-start .resize-handle.bottom { bottom: -4px; }
.left-column .task-item span[contenteditable="true"].task-description-text { outline: none; padding: 0; border: none; background: transparent; cursor: text; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
.left-column .task-item .task-description-text { margin-right: 10px; flex-grow: 1; word-break: break-word; min-width: 0; }
.left-column .task-item.completed .task-description-text { text-decoration: line-through; color: #6c757d; cursor: default; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
.left-column .activity .editable-empty-slot { flex-grow: 1; padding: 8px 12px; border-radius: 6px; font-size: 0.9em; border: 1px dashed var(--planner-border-color); outline: none; min-height: 34px; color: #6c757d; background-color: #f1f3f5; transition: border-color 0.2s ease, background-color 0.2s ease; display: flex; align-items: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; height: 100%; box-sizing: border-box; }
.left-column .activity .editable-empty-slot:empty::before { content: 'Click to add task...'; color: #adb5bd; font-style: italic; width: 100%; }
.left-column .activity .editable-empty-slot:focus { border-color: var(--planner-secondary-color); background-color: #e9ecef; }
.left-column .activity .editable-empty-slot:focus::before { content: ''; }
.left-column .task-content .task-complete-checkbox { flex-shrink: 0; cursor: pointer; appearance: none; width: 18px; height: 18px; border: 1px solid var(--planner-secondary-color); border-radius: 4px; position: relative; transition: background-color 0.2s ease; margin-left: 5px; order: 3; }
.left-column .task-content .task-complete-checkbox:checked { background-color: var(--planner-secondary-color); border-color: var(--planner-secondary-color); }
.left-column .task-content .task-complete-checkbox:checked::after { content: '✔'; color: white; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 12px; font-weight: bold; line-height: 1; }
.left-column .task-content.completed .task-complete-checkbox { cursor: pointer; }
.left-column .task-content .completion-status { font-weight: bold; color: var(--planner-primary-color); margin-right: 10px; font-size: 0.9em; display: none; order: 0; }
.left-column .task-content .task-actions { display: none; gap: 8px; align-items: center; margin-left: auto; order: 2; }
.left-column .task-content.completed .task-actions { display: flex; }
.left-column .task-content.media-attached .task-actions .action-upload,
.left-column .task-content.media-attached .task-actions .action-camera { display: none; }
.left-column .task-content .task-actions .action-view-media { display: none; }
.left-column .task-content.media-attached .task-actions .action-view-media { display: inline-block; }
.left-column .task-content .task-actions i { font-size: 1.1em; cursor: pointer; color: var(--planner-secondary-color); transition: color 0.2s ease; }
.left-column .task-content .task-actions i:hover { color: var(--planner-primary-color); }
.left-column .task-content .task-actions .action-view-media { color: var(--planner-accent-color); }
.left-column .task-content .task-actions .action-view-media:hover { color: #d48800; }
.left-column .task-segment-start .task-content.completed .completion-status { display: inline; }
.left-column .task-essay { background-color: var(--planner-task-color-1); border-left-color: var(--planner-task-color-1-border); }
.left-column .task-logo { background-color: var(--planner-task-color-2); border-left-color: var(--planner-task-color-2-border); }
.left-column .task-video { background-color: var(--planner-task-color-3); border-left-color: var(--planner-task-color-3-border); }
.left-column .task-break { background-color: var(--planner-task-color-break); border-left-color: var(--planner-task-color-break-border); font-style: italic; color: #6c757d; cursor: default !important; }
.left-column .task-other { background-color: var(--planner-task-color-default); border-left-color: var(--planner-task-color-default-border); }
.left-column .task-default { background-color: var(--planner-task-color-default); border-left-color: var(--planner-task-color-default-border); }
.left-column .task-item.completed:not(.task-break):not(.priority) { background-color: #f1f3f5; border-left-color: #adb5bd; background-image: none; }
.left-column .task-item.completed.priority {
    background-image: linear-gradient(to bottom right, var(--priority-task-gradient-start), var(--priority-task-gradient-end));
    opacity: 0.7;
}

.left-column .task-break .task-content, .left-column .task-break .delete-task, .left-column .task-break .resize-handle { display: none !important; visibility: hidden !important; pointer-events: none !important; }
.left-column .task-break.task-segment-start { padding-top: 8px; padding-bottom: 8px; }
.left-column .task-break.task-segment-middle, .left-column .task-break.task-segment-end { padding-top: 8px; padding-bottom: 8px; }
.left-column .task-break.task-segment-start::before { content: 'Break'; display: block; font-style: italic; color: #6c757d; text-align: center; width: 100%; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
.left-column .schedule-display > .status-message { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80%; max-width: 400px; box-sizing: border-box; z-index: 5; text-align: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; padding: 15px; background-color: rgba(255,255,255,0.9); border-radius: var(--radius-medium); }
.left-column .status-error { color: var(--planner-error-color); font-weight: bold; }
.left-column .status-loading { color: var(--planner-loading-color); }
.dragging-or-resizing * { user-select: none !important; -webkit-user-select: none !important; -moz-user-select: none !important; -ms-user-select: none !important; }
.dragging-or-resizing { cursor: ns-resize !important; }

.pet-container { background-color: var(--container-bg); border-radius: var(--radius-large); padding: 20px 25px; box-shadow: var(--shadow-medium); width: 100%; box-sizing: border-box; text-align: center; border: 1px solid var(--border-light); }
.pet-container h2 { margin-bottom: 10px; font-size: 1.6em; }
.pet-room { position: relative; width: 100%; padding-bottom: 100%; overflow: hidden; margin-bottom: 10px; }
.room-layer { position: absolute; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.wall { top: 0; left: 0; }
.floor { bottom: 0; left: 0; }
.rug { bottom: 0; left: 0; }
.pet-display-area { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; display: flex; justify-content: center; align-items: center; }
#pet {
    width: 540px;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.speech-bubble { position: absolute; bottom: 70%; left: 50%; transform: translateX(-50%); min-width: 120px; max-width: 200px; background-color: var(--speech-bubble-bg); border: 1px solid var(--speech-bubble-border); border-radius: var(--radius-large); padding: 8px 12px; font-size: 0.8em; color: var(--speech-bubble-text); box-shadow: var(--shadow-light); z-index: 20; opacity: 0; visibility: hidden; transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out; text-align: center; }
.speech-bubble.visible { opacity: 1; visibility: visible; }
.speech-bubble::after { content: ''; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border: 10px solid transparent; border-top-color: var(--speech-bubble-bg); border-bottom-width: 0; filter: drop-shadow(0px 2px 1px rgba(0, 0, 0, 0.05)); }
.speech-bubble::before { content: ''; position: absolute; bottom: -11px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border: 11px solid transparent; border-top-color: var(--speech-bubble-border); border-bottom-width: 0; z-index: -1; }
#pet-message { margin: 0; font-weight: bold; }
.pet-accessories { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.pet-container p:first-of-type { margin-top: 5px; margin-bottom: 15px; font-weight: 600; color: var(--text-dark); font-size: 1.1em; }
.stat-container { margin-bottom: 12px; text-align: left; padding: 0 10px; }
.stat-container label { display: block; margin-bottom: 4px; font-size: 0.9em; font-weight: 600; color: var(--text-medium); }
.stat-display-wrapper { display: flex; align-items: center; gap: 10px; }
.stat-bar-bg { background-color: var(--stat-bg); border-radius: var(--radius-round); overflow: hidden; height: 16px; flex-grow: 1; border: 1px solid var(--border-light); }
.stat-bar { height: 100%; border-radius: var(--radius-round); width: 0%; transition: width 0.4s ease, background-color 0.4s ease; }
.stat-value { font-size: 0.9em; font-weight: 700; color: var(--text-dark); min-width: 30px; text-align: right; }
.token-display-container { background: linear-gradient(135deg, var(--token-bg-start), var(--token-bg-end)); color: var(--token-text); padding: 8px 18px; border-radius: var(--radius-round); display: flex; align-items: center; justify-content: center; margin: 15px auto 20px auto; font-weight: 700; font-size: 1.1em; box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1), inset 0 -2px 2px rgba(0,0,0,0.1); border: 1px solid var(--token-border); min-width: 90px; text-align: center; transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.27, 1.55), background 0.2s ease-out, color 0.2s ease-out; }
.token-icon { margin-right: 8px; font-size: 1.3em; line-height: 1; }
.token-label { font-size: 0.8em; margin-left: 4px; font-weight: 500; opacity: 0.9; }
.token-display-container.updated-increase { transform: scale(1.15); background: linear-gradient(135deg, var(--token-increase-bg-start), var(--token-increase-bg-end)); color: var(--token-increase-text); }
.token-display-container.updated-decrease { transform: scale(0.95); background: linear-gradient(135deg, var(--token-decrease-bg-start), var(--token-decrease-bg-end)); color: var(--token-decrease-text); }
.pet-button { margin: 5px; padding: 10px 15px; border: none; cursor: pointer; border-radius: var(--radius-medium); background-color: var(--accent-pink); color: var(--text-light); font-size: 0.9em; font-weight: 600; transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease; font-family: inherit;}
.pet-button:hover { background-color: var(--accent-pink-hover); transform: translateY(-2px); box-shadow: var(--shadow-medium); }
.pet-button:active { transform: translateY(0px); }
#customize-pet-button { display: block; width: 80%; max-width: 250px; margin: 20px auto 15px auto; padding: 12px 20px; background-color: var(--info-blue); color: white; font-size: 1em; font-weight: 600; }
#customize-pet-button:hover { background-color: var(--info-blue-hover); }

#pet-customization-modal .modal-content.pet-customize-content {
    text-align: left;
    max-height: 85vh;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

.pet-customize-columns {
    display: flex;
    gap: 20px;
    align-items: stretch;
    flex-grow: 1;
    min-height: 0;
    overflow: hidden;
}
.pet-customize-tabs {
    display: flex;
    flex-direction: column;
    width: 150px;
    flex-shrink: 0;
}
.tab-button { padding: 10px 15px; background-color: #f0f0f0; border: 1px solid #ccc; border-radius: var(--radius-medium); margin-bottom: 5px; cursor: pointer; text-align: center; font-weight: 500; transition: background-color 0.2s ease; }
.tab-button.active { background-color: var(--info-blue); color: white; border-color: var(--info-blue); }

.pet-customize-options {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.tab-content {
    display: none;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 350px;
    padding: 10px;
    padding-bottom: 20px;

    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.3) transparent;
}
.tab-content::-webkit-scrollbar { width: 6px; }
.tab-content::-webkit-scrollbar-track { background: transparent; }
.tab-content::-webkit-scrollbar-thumb { background-color: rgba(128, 128, 128, 0.3); border-radius: 6px; }
.tab-content:hover::-webkit-scrollbar-thumb { background-color: rgba(128, 128, 128, 0.6); }

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.pet-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 10px 0;
}

.pet-color-option {
    padding: 5px;
    border-radius: var(--radius-medium);
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--container-bg);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.pet-color-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-accent);
}

.pet-color-option img {
    display: block;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius-small);
}

.pet-color-option.selected-color {
    border-color: var(--primary-accent-hover);
    box-shadow: 0 0 10px rgba(0, 100, 255, 0.5);
}


#environment-tab h4, #environment-tab h5 {
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}
.environment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.environment-option {
    padding: 5px;
    border-radius: var(--radius-medium);
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease, border-color 0.2s ease;
    background: var(--container-bg);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.environment-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-accent);
}
.environment-option img {
    display: block;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius-small);
}
.environment-option.selected-env {
    border: 2px solid var(--primary-accent-hover) !important;
    box-shadow: 0 0 8px var(--primary-accent-hover) !important;
}


.pet-customize-preview {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}
.pet-customize-preview label { display: block; margin-bottom: 5px; color: var(--text-medium); }
.pet-customize-preview input { padding: 8px; border: 1px solid var(--border-medium); border-radius: var(--radius-medium); margin-bottom: 15px; width: 100%; max-width: 200px; }
.pet-customize-preview .preview-room { width: 100%; max-width: 200px; height: 0; padding-bottom: 100%; position: relative; margin: 10px auto; overflow: hidden; }
.preview-room .room-layer{ position: absolute; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.preview-room #pet-preview{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: auto; max-width: 300px; max-height: 300px; object-fit: contain; z-index: 2; }


#pet-customize-exit-confirm .modal-content.small-modal { max-width: 400px; }
#pet-customize-exit-confirm h2 { color: var(--danger-red); }
#pet-customize-exit-confirm p { text-align: center; margin-bottom: 20px; }
#pet-customize-exit-confirm .prompt-buttons { justify-content: center; }

.prompt-buttons { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; }
.prompt-button { padding: 0.7rem 1.5rem; border-radius: var(--radius-medium); font-size: 1em; font-weight: 600; cursor: pointer; border: 1px solid transparent; margin-top: 1.5rem; }
.prompt-button.primary { background-color: var(--success-green); color: white; border-color: var(--success-green); }
.prompt-button.primary:hover { background-color: darkgreen; border-color: darkgreen; }
.prompt-button.secondary { background-color: transparent; color: var(--text-medium); border-color: var(--border-medium); }


.simple-pomodoro-container { background-color: var(--container-bg); border-radius: var(--radius-large); padding: 20px 25px; box-shadow: var(--shadow-medium); width: 100%; box-sizing: border-box; text-align: center; border: 1px solid var(--border-light); }
.simple-pomodoro-container h2 { font-size: 1.6em; margin-bottom: 0.5rem; }
.simple-pomodoro-container .text { font-size: 0.9em; margin-bottom: 1rem; color: var(--text-medium); }
#start-pomodoro-btn { padding: 10px 25px; font-size: 1em; background-color: var(--danger-red); color: white; border: none; border-radius: var(--radius-small); cursor: pointer; font-weight: 600; font-family: inherit; }
#start-pomodoro-btn:hover { background-color: var(--danger-red-hover); }
#pomodoro-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--simple-pomodoro-overlay-bg); display: none; flex-direction: column; justify-content: center; align-items: center; z-index: 3000; color: white; padding: 20px; box-sizing: border-box; }
#pomodoro-timer-display { display: flex; flex-direction: column; align-items: center; width: 100%; }
#pomodoro-overlay-timer { font-size: 12em; font-weight: 700; font-family: inherit; text-shadow: 2px 2px 8px rgba(0,0,0,0.6); margin-bottom: 1rem; }
#pomodoro-stop-btn { padding: 10px 20px; font-size: 1.2em; background-color: rgba(255, 255, 255, 0.2); color: white; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: var(--radius-small); cursor: pointer; font-weight: 500; margin-top: 1.5rem; transition: background-color 0.2s ease; font-family: inherit; }
#pomodoro-stop-btn:hover { background-color: rgba(255, 255, 255, 0.35); border-color: rgba(255, 255, 255, 0.8); }
#pomodoro-exit-confirm {
    background-color: var(--pomodoro-confirm-bg);
    color: var(--text-dark); padding: 25px 30px;
    border-radius: var(--radius-medium); box-shadow: var(--shadow-large);
    max-width: 90%; width: 500px; text-align: center; display: none;
    flex-direction: column;}
#pomodoro-quote { font-size: 1.1em; font-style: italic; color: var(--text-medium); margin-bottom: 1.5rem; line-height: 1.5; }
.pomodoro-confirm-buttons { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; }
.pomodoro-confirm-buttons button { padding: 10px 20px; border-radius: var(--radius-small); font-size: 1em; font-weight: 600; cursor: pointer; border: 1px solid transparent; font-family: inherit; }
#pomodoro-continue-btn { background-color: var(--success-green); color: white; border-color: var(--success-green); }
#pomodoro-continue-btn:hover { background-color: var(--success-green-hover); border-color: var(--success-green-hover); }
#pomodoro-confirm-exit-btn { background-color: var(--danger-red); color: white; border-color: var(--danger-red); }
#pomodoro-confirm-exit-btn:hover { background-color: var(--danger-red-hover); border-color: var(--danger-red-hover); }

#confirm-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--overlay-bg); display: none; justify-content: center; align-items: center; z-index: 1200; padding: 20px; opacity: 0; transition: opacity 0.3s ease; }
#confirm-overlay.active { display: flex; opacity: 1; }
#confirm-message { background-color: var(--container-bg-alt); padding: 25px 35px; border-radius: var(--radius-medium); font-size: 1.2em; font-weight: 500; color: var(--text-dark); text-align: center; box-shadow: var(--shadow-large); max-width: 90%; }

.buddycam-container { width: 100%; max-width: 900px; margin: 20px auto; padding: 25px; background-color: var(--container-bg); border-radius: var(--radius-large); box-shadow: var(--shadow-medium); text-align: center; border: 1px solid var(--border-light); display: none; }
.buddycam-header h2 { margin-bottom: 0.5rem; }
.buddycam-description { color: var(--text-medium); margin-bottom: 1.5rem; font-size: 1.05em; }
.camera-container { position: relative; width: 100%; max-width: 640px; margin: 0 auto 1.5rem auto; background-color: #000; border-radius: var(--radius-medium); overflow: hidden; border: 1px solid var(--border-dark); }
#camera-feed { display: block; width: 100%; height: auto; transform: scaleX(-1); }
.buddy-character { position: absolute; bottom: 15px; right: 15px; width: 100px; text-align: center; z-index: 10; }
#buddy-image { width: 80px; height: 80px; display: block; margin: 0 auto 5px auto; cursor: pointer; filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.3)); }
#buddy-message { background-color: rgba(0, 0, 0, 0.6); color: white; padding: 5px 8px; border-radius: var(--radius-small); font-size: 0.8em; opacity: 0; transition: opacity 0.5s ease; }
#start-buddycam.start-button { padding: 10px 25px; font-size: 1em; background-color: var(--success-green); color: white; border: none; border-radius: var(--radius-small); cursor: pointer; font-weight: 600; font-family: inherit;}
#start-buddycam.start-button:hover { background-color: var(--success-green-hover); }

button:focus, input:focus, textarea:focus { outline: 2px solid var(--primary-accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--container-bg);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 10px;
    border: 2px solid var(--container-bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-medium);
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width-collapsed);
    background: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: width 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #eee;
}

.sidebar:hover {
    width: var(--sidebar-width-expanded);
}

.sidebar .sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #eee;
}

.sidebar .sidebar-header h1 {
    font-size: 1.2rem;
    margin: 0;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #4f46e5;
}

.sidebar:hover .sidebar-header h1 {
    opacity: 1;
}

.sidebar ul.nav-items {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.sidebar .nav-item i {
    font-size: 1.2rem;
    width: 40px;
    text-align: center;
    margin-right: 0;
}
.sidebar:not(:hover) .nav-item {
    padding-left: calc((var(--sidebar-width-collapsed) - 40px) / 2);
}
.sidebar:hover .nav-item {
    padding-left: 20px;
}


.sidebar .nav-item:hover {
    background: #f8f9fa;
    color: #4f46e5;
}

.sidebar .nav-item.active {
    background: #f0f0ff;
    color: #4f46e5;
    border-left: 3px solid #4f46e5;
}


.sidebar .nav-item span {
    margin-left: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar:hover .nav-item span {
    opacity: 1;
}

.top-right-items {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1001;
}

.top-right-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-light);
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.top-right-item:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.top-right-item i {
    color: #4f46e5;
}

.top-right-item span {
    color: #333;
    font-size: 0.9rem;
}

.top-right-items .account-profile {
    display: flex;
    align-items: center;
    padding: 0;
    background: transparent;
    border-radius: 50%;
    box-shadow: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.top-right-items .account-profile:hover {
    transform: scale(1.1);
}
.top-right-items .account-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #4f46e5;
}


.container {
    padding: 20px 30px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    box-sizing: border-box;
    max-width: 1400px;
    margin-right: auto;
    margin-left: var(--sidebar-width-collapsed);
}
body:not(.has-sidebar) .container {
    margin-left: auto;
}

.sidebar:hover ~ .container {
    margin-left: var(--sidebar-width-expanded);
}


.forum-header {
    padding: 15px 0;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-light);
}
.forum-header h1 {
    font-size: 2em;
    color: var(--primary-accent);
    margin-bottom: 0.25rem;
}
.forum-header p {
    font-size: 1em;
    color: var(--text-medium);
    margin-bottom: 0;
}

.create-post,
.posts {
    background-color: var(--container-bg-alt);
    padding: 20px 25px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-medium);
    margin-bottom: 25px;
    border: 1px solid var(--border-light);
}

.create-post h2,
.posts h2 {
    font-size: 1.5em;
    color: var(--text-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

#post-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-medium);
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
    margin-bottom: 15px;
}
#post-form textarea:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

#post-form .post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.photo-upload-container .photo-upload-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background-color: var(--container-bg);
    color: var(--primary-accent);
    border: 1px dashed var(--primary-accent);
    border-radius: var(--radius-medium);
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}
.photo-upload-container .photo-upload-btn:hover {
    background-color: #e9ecef;
}
.photo-upload-container .photo-upload-btn i {
    margin-right: 8px;
}

.post-btn {
    padding: 10px 25px;
    background-color: var(--primary-accent);
    color: white;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.post-btn:hover {
    background-color: var(--primary-accent-hover);
}

.selected-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}
.selected-photos img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-small);
    border: 1px solid var(--border-light);
}

#posts-container .post {
    background-color: var(--container-bg-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-medium);
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-light);
}
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.post-info {
    display: flex;
    flex-direction: column;
}
.post-author {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95em;
    margin-bottom: 2px;
}
.post-time {
    font-size: 0.8em;
    color: var(--text-medium);
}
.post-content {
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 15px;
    white-space: pre-wrap;
}
.post-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}
.post-images img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: var(--radius-small);
    cursor: pointer;
}
.post-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border-light);
}
.post-actions .like-btn,
.post-actions .comment-btn,
.post-actions .share-btn {
    background: none;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    font-size: 0.9em;
    padding: 5px;
    display: inline-flex;
    align-items: center;
}
.post-actions .like-btn i,
.post-actions .comment-btn i,
.post-actions .share-btn i {
    margin-right: 6px;
    font-size: 1.1em;
}
.post-actions .like-btn.liked i {
    color: var(--danger-red);
}
.post-actions .like-btn:hover,
.post-actions .comment-btn:hover,
.post-actions .share-btn:hover {
    color: var(--primary-accent);
}
.post-actions .likes-count,
.post-actions .comments-count {
    margin-left: 4px;
}

.comments-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-light);
}
.comments-list .comment {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
}
.comments-list .comment:last-child {
    border-bottom: none;
}
.comments-list .comment-author {
    font-weight: 500;
    color: var(--text-dark);
    margin-right: 5px;
}
.comments-list .comment-text {
    color: var(--text-medium);
}

.add-comment {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.add-comment .comment-input {
    flex-grow: 1;
    padding: 8px 10px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-medium);
    font-size: 0.9em;
}
.add-comment .comment-submit-btn {
    padding: 8px 15px;
    background-color: var(--primary-accent);
    color: white;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 0.9em;
    cursor: pointer;
}
.add-comment .comment-submit-btn:hover {
    background-color: var(--primary-accent-hover);
}

.login-prompt-content {
    background: var(--container-bg-alt);
    padding: 20px;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-large);
    text-align: center;
}


.group-join-container {
    max-width: 480px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.group-join-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}
.group-join-container:hover {
    transform: translateY(-2px);
}
.group-join-container h1, .group-join-container h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 1rem;
}
.group-join-container h1::after, .group-join-container h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 2px;
}
.form-group {
    margin-bottom: 1.75rem;
    position: relative;
}
.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}
.form-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
    color: var(--text-primary);
}
.form-group input:focus {
    border-color: #4f46e5;
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.join-room-btn {
    width: 100%;
    padding: 1.125rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}
.join-room-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}
.join-room-btn:hover::before {
    left: 100%;
}
.join-room-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.chat-container {
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
    height: 85vh;
    display: flex;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

body.chat-page .chat-container {
    margin-left: var(--sidebar-width-collapsed);
    height: 100vh;
    border-radius: 0;
    margin-top: 0;
    margin-bottom: 0;
}
body.chat-page.sidebar-expanded .chat-container {
    margin-left: var(--sidebar-width-expanded);
}


.chat-sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}
.chat-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}
.chat-sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}
.chat-list {
    flex: 1;
    overflow-y: auto;
}
.chat-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}
.chat-item:hover { background: #f8f9fa; }
.chat-item.active { background: #f0f0ff; }
.chat-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
}
.chat-item-info { flex: 1; }
.chat-item-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}
.chat-item-last-message {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.chat-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-bottom: 1px solid #eee;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}
.chat-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}
.chat-header .chat-header-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
}
.leave-room-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.025em;
    backdrop-filter: blur(4px);
}
.leave-room-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.chat-messages {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}
.message {
    max-width: 75%;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    position: relative;
    animation: messageAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.5;
}
@keyframes messageAppear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.message.sent {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}
.message.received {
    background: white;
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}
.message .username {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    font-weight: 600;
    letter-spacing: 0.025em;
}
.message .time, .message-time {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.5rem;
    display: block;
    color: #666;
    text-align: right;
}
.message.sent .time, .message.sent .message-time {
    color: rgba(255,255,255,0.8);
}
.chat-input-container {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    position: relative;
}
.chat-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}
.chat-input-container input, .chat-input-field {
    flex-grow: 1;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
    color: var(--text-primary);
    outline: none;
}
.chat-input-container input:focus, .chat-input-field:focus {
    border-color: #4f46e5;
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.chat-input-container button, .chat-input-btn {
    padding: 1rem 1.75rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    font-size: 0.875rem;
}
.chat-input-container button:hover, .chat-input-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: #4338ca;
}
.chat-input-btn i { font-size: 1.2rem; }
.message.system {
    background: #fef3c7;
    color: #92400e;
    align-self: center;
    text-align: center;
    font-size: 0.875rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 0.75rem 0;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    letter-spacing: 0.025em;
}
.chat-empty-state {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #666; text-align: center; padding: 20px;
}
.chat-empty-state i { font-size: 4rem; color: #ddd; margin-bottom: 20px; }
.chat-empty-state h3 { margin: 0 0 10px 0; font-size: 1.5rem; }
.chat-empty-state p { margin: 0; font-size: 1rem; }

.settings-panel {
    position: fixed; right: -400px; top: 0; width: 400px; height: 100vh;
    background: white; box-shadow: var(--shadow-lg); transition: right 0.3s ease;
    z-index: 1000; display: flex; flex-direction: column;
}
.settings-panel.active { right: 0; }
.settings-panel .settings-header {
    padding: 1.5rem; background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white; display: flex; justify-content: space-between; align-items: center;
}
.settings-panel .settings-header h3 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.close-settings { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: 0.5rem; }
.settings-content { flex: 1; overflow-y: auto; padding: 1.5rem; }
.settings-section { margin-bottom: 2rem; }
.settings-section h4 { color: var(--text-secondary); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.settings-item { display: flex; align-items: center; padding: 1rem; border-radius: var(--radius-md); cursor: pointer; transition: background-color 0.2s; }
.settings-item:hover { background-color: #f1f5f9; }
.settings-item i { width: 24px; margin-right: 1rem; color: var(--text-secondary); }
.settings-item span { flex: 1; color: var(--text-primary); }
.settings-item .arrow { color: var(--text-secondary); }
.group-info { text-align: center; padding: 2rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.group-avatar {
    width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 1rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: white;
    cursor: pointer; position: relative; overflow: hidden;
}
.group-avatar input[type="file"] { position: absolute; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.group-name { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-primary); }
.group-description { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 1rem; }
.customization-modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); z-index: 1100; align-items: center; justify-content: center;
}
.customization-modal.active { display: flex; }
.customization-modal .modal-body { padding: 1.5rem; }
.color-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1rem; }
.color-option { width: 100%; aspect-ratio: 1; border-radius: var(--radius-md); cursor: pointer; border: 2px solid transparent; transition: all 0.2s; }
.color-option:hover { transform: scale(1.05); }
.color-option.active { border-color: var(--text-primary); }
.settings-toggle { background: none; border: none; color: white; font-size: 1.25rem; cursor: pointer; padding: 0.5rem; margin-left: 1rem; }
.member-list { margin-top: 1rem; }
.member-item { display: flex; align-items: center; padding: 0.75rem; border-radius: var(--radius-md); }
.member-item:hover { background-color: #f1f5f9; }
.member-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    margin-right: 1rem; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 500;
}
.member-info { flex: 1; }
.member-name { font-weight: 500; color: var(--text-primary); }
.member-role { font-size: 0.75rem; color: var(--text-secondary); }
.member-actions { display: flex; gap: 0.5rem; }
.member-action-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 0.25rem; border-radius: var(--radius-sm); }
.member-action-btn:hover { background-color: var(--border-color); color: var(--text-primary); }


.challenge-container {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.challenge-header {
    text-align: center;
    margin-bottom: 40px;
}
.challenge-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
}
.challenge-header p {
    color: #666;
    font-size: 1.1rem;
}
.challenge-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}
.challenge-form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.challenge-form h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}
.challenge-form .form-group {
    margin-bottom: 20px;
}
.challenge-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}
.challenge-form .form-group input,
.challenge-form .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}
.challenge-form .form-group input:focus,
.challenge-form .form-group textarea:focus {
    border-color: #4f46e5;
    outline: none;
}
.photo-upload {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}
.photo-upload:hover {
    border-color: #4f46e5;
    background: #f8f9fa;
}
.photo-upload i {
    font-size: 2rem;
    color: #666;
    margin-bottom: 10px;
}
.photo-upload p {
    color: #666;
    margin: 0;
}
.photo-capture {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 15px;
}
.photo-capture video {
    width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}
.photo-capture video.show { display: block; }
.photo-capture-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.capture-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.capture-btn:hover { background: #4338ca; transform: translateY(-2px); }
.capture-btn i { font-size: 1.1rem; }
.capture-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }
.photo-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.photo-option {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.photo-option:hover { border-color: #4f46e5; background: #f8f9fa; }
.photo-option.active { border-color: #4f46e5; background: #f0f0ff; }
.photo-option i { font-size: 1.5rem; color: #666; margin-bottom: 8px; }
.photo-option p { margin: 0; color: #666; font-size: 0.9rem; }
.submit-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
    width: 100%;
}
.submit-btn:hover { background: #4338ca; }
.submit-btn:disabled { background: #ccc; cursor: not-allowed; }
.photo-preview {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}
.photo-preview h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}
.preview-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}
.preview-image.show { display: block; }
.preview-placeholder {
    padding: 40px;
    color: #666;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
}
.preview-placeholder i { font-size: 3rem; color: #ddd; margin-bottom: 15px; }
.preview-placeholder p { margin: 0; font-size: 1.1rem; }
.preview-details {
    text-align: left;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}
.preview-details h3 { color: #333; margin-bottom: 15px; font-size: 1.2rem; }
.preview-details p { color: #666; margin: 5px 0; }

@media (max-height: 850px) {
    #pet-customization-modal .modal-content.pet-customize-content { max-height: 75vh; }
    #pet-customization-modal .tab-content { max-height: 250px; }
}

@media (max-width: 1200px) {
    .main-container { flex-direction: column; align-items: center; gap: 30px; padding: 0 10px;}
    .left-column, .right-column { flex-basis: auto; width: 100%; max-width: 850px; min-width: unset; }
    .right-column { max-width: 500px; }
    .left-column .planner-main { padding: 0px 25px 25px 25px; gap: 25px;}
    .planner-controls-wrapper.hidden { margin-right: 0; }
    .planner-controls-wrapper:not(.hidden) { min-width: unset; width: 100%; }
}

@media (max-width: 768px) {
    body:not(.has-sidebar) .header { padding: 0.6rem 1rem; height: 60px; }
    body:not(.has-sidebar) { padding-top: 60px; }
    body:not(.has-sidebar) .header h1 { font-size: 1.5em; }
    body:not(.has-sidebar) .user-profile { gap: 0.5rem; }
    body:not(.has-sidebar) #username-display { display: none; }
    body:not(.has-sidebar) .user-profile img#profile-image { width: 35px; height: 35px; }
    body:not(.has-sidebar) .user-profile button { font-size: 0.8em; padding: 0.3rem 0.6rem; }

    .main-container { margin-top: 10px; gap: 20px; padding: 0 10px;}
    .left-column, .right-column { max-width: 95%; }
    .nav-menu { width: 250px; left: -250px;}

    .left-column { border-radius: 8px; min-width: unset; }
    .left-column .planner-header { padding: 15px 20px; border-radius: 8px 8px 0 0;}
    .left-column .planner-header > h1 { font-size: 1.5em;}
    .planner-controls-header-internal h2 { font-size: 1.2em;}
    .schedule-section-header h2 { font-size: 1.3em; margin-bottom: 10px; }
    .left-column .planner-main { gap: 20px; padding: 0 20px 15px 20px; }

    .left-column .input-group label, .left-column .slider-group > label { font-size: 0.85em; margin-bottom: 5px;}
    .left-column textarea#task-input, .left-column input[type="text"] { padding: 8px;}
    .left-column .radio-group { padding: 8px;}
    .left-column .radio-group label { margin-right: 10px; font-size: 0.9em;}
    .left-column button#generate-schedule { padding: 10px 20px; font-size: 1em;}
    .left-column button.planner-action-button { padding: 8px 15px; font-size: 0.9em; margin-top: 15px;}
    .left-column .schedule-display { height: 60vh; }
    .left-column .time { flex-basis: 70px; font-size: 0.8em; padding: 5px;}
    .left-column .task-item { padding: 6px 10px; font-size: 0.85em; border-left-width: 3px; min-height: 30px;}
    .left-column .task-segment-start .priority-star { font-size: 1em;}
    .left-column .task-segment-start .delete-task { width: 16px; height: 16px; font-size: 0.7em; top: -6px; right: -6px;}
    .left-column .task-segment-start .resize-handle { height: 6px; border-width: 1px;}
    .left-column .task-segment-start .resize-handle.top { top: -3px;}
    .left-column .task-segment-start .resize-handle.bottom { bottom: -3px;}
    .left-column .task-content .task-actions i { font-size: 1em; }
    .left-column .task-content .task-complete-checkbox { width: 16px; height: 16px;}

    #pet-customization-modal .pet-customize-columns { flex-direction: column; }
    #pet-customization-modal .pet-customize-tabs { width: 100%; flex-direction: row; justify-content: space-around; margin-bottom: 15px; }
    #pet-customization-modal .tab-button { margin-bottom: 0; margin-right: 5px; flex: 1; }
    #pet-customization-modal .tab-content { max-height: 250px; }


    .modal { padding: 20px; max-width: 90%; }
    .modal h3, .modal .modal-header h2, .modal-content .modal-header h2 { font-size: 1.3em; margin-bottom: 15px;}
    .modal .modal-buttons { gap: 10px;}
    .modal .modal-buttons button { padding: 8px 15px; font-size: 0.9em;}
    #reset-confirm-modal { max-width: 90%; }
    #info-box { max-width: 90%; }
    #info-box .close-btn { font-size: 1.4em; top:10px; right: 10px;}
    #camera-modal video { max-width: 100%; }

    .right-column { max-width: 95%; }
    .token-display-container { font-size: 1em; padding: 6px 12px;}
    .pet-container { padding: 15px; }
    #pet { width: 120px; }
    .stat-display-wrapper { gap: 5px;}
    .stat-bar-bg { height: 14px;}
    .stat-value { font-size: 0.8em; min-width: 25px;}
    .pet-button { padding: 8px 12px; font-size: 0.85em;}

    .simple-pomodoro-container { padding: 15px; }
    #start-pomodoro-btn { padding: 8px 20px; }
    #pomodoro-overlay-timer { font-size: 8em; }
    #pomodoro-stop-btn { font-size: 1.2em; padding: 10px 20px; margin-top: 1.5rem; }
    #pomodoro-exit-confirm { width: 90%; padding: 20px; }
    #pomodoro-quote { font-size: 1em; }
    .pomodoro-confirm-buttons { flex-direction: row; gap: 1rem;}
    .pomodoro-confirm-buttons button { width: auto; }

    .container {
        margin-left: var(--sidebar-width-collapsed);
        padding: 15px;
    }
    .sidebar:hover ~ .container {
        margin-left: var(--sidebar-width-expanded);
    }
    .top-right-item span { display: none; }
    .top-right-item { padding: 8px 10px; }
    .top-right-items { gap: 10px; right: 15px; }

    .forum-header h1 { font-size: 1.8em; }
    .forum-header p { font-size: 0.9em; }
    .create-post, .posts { padding: 15px; }
    .create-post h2, .posts h2 { font-size: 1.3em; }
    #post-form .post-actions { flex-direction: column; gap: 10px; align-items: stretch; }
    .photo-upload-container .photo-upload-btn, .post-btn { width: 100%; text-align: center; justify-content: center;}
    .post-images img { max-height: 200px; }
    .add-comment { flex-direction: column; gap: 8px; }
    .add-comment .comment-input, .add-comment .comment-submit-btn { width: 100%; }

    .group-join-container { margin: 1.5rem auto; padding: 1.5rem; }
    .group-join-container h1, .group-join-container h2 { font-size: 1.5rem; margin-bottom: 1.5rem; padding-bottom: 0.5rem;}
    .group-join-container h1::after, .group-join-container h2::after { width: 50px; height: 2px; }
    .join-room-btn { padding: 1rem; font-size: 1rem; }

    .chat-container {
        margin-left: var(--sidebar-width-collapsed);
        flex-direction: row;
        height: calc(100vh - 70px);
        margin-top: 0;
    }
     body.chat-page .chat-container {
        height: 100vh;
        margin-left: var(--sidebar-width-collapsed);
    }
    body.chat-page.sidebar-hover .chat-container {
        margin-left: var(--sidebar-width-expanded);
    }

    .chat-sidebar {
        width: 250px;
        height: 100%;
        border-right: 1px solid #eee;
        border-bottom: none;
    }
    .chat-main { flex-grow: 1; }
    .chat-header { padding: 1rem 1.5rem; }
    .chat-header h2, .chat-header .chat-header-info h3 { font-size: 1.2rem; }
    .leave-room-btn, .settings-toggle { padding: 0.5rem 1rem; font-size: 0.9rem;}
    .chat-messages { padding: 1rem; gap: 0.75rem; }
    .message { padding: 0.75rem 1rem; max-width: 85%; }
    .chat-input-container { padding: 1rem 1.5rem; flex-direction: row; }
    .chat-input-container input { width: auto; flex-grow: 1;}
    .chat-input-container button { width: auto; }
    .settings-panel { width: 300px; right: -300px; }

    .challenge-container { padding: 20px; }
    .challenge-header h1 { font-size: 1.8em; }
    .challenge-header p { font-size: 1em; }
    .challenge-content { grid-template-columns: 1fr; gap: 25px; }
    .challenge-form, .photo-preview { padding: 20px; }
    .challenge-form h2, .photo-preview h2 { font-size: 1.3em; }
    .photo-options { flex-direction: row; }
}


@media (max-width: 480px) {
    body:not(.has-sidebar) .header { padding: 0.5rem 0.8rem; height: 55px; }
    body:not(.has-sidebar) { padding-top: 55px; }
    body:not(.has-sidebar) .header-left { gap: 0.5rem; }
    body:not(.has-sidebar) .header-logo { height: 28px; margin-right: 0.1rem;}
    body:not(.has-sidebar) .header h1 { font-size: 1.3em; }
    body:not(.has-sidebar) .user-profile button#profile-button { display: none; }
    body:not(.has-sidebar) .guest-profile .header-auth-button { padding: 0.3rem 0.7rem; font-size: 0.85em;}
    body:not(.has-sidebar) .user-profile img#profile-image { width: 30px; height: 30px; }

    .main-container { padding: 0 5px; gap: 15px;}
    .left-column, .right-column { max-width: 100%; }

    .left-column { border-radius: 6px;}
    .left-column .planner-header { padding: 10px 15px; border-radius: 6px 6px 0 0;}
    .left-column .planner-header > h1 { font-size: 1.3em;}
    .planner-controls-header-internal h2 { font-size: 1.1em;}
    .schedule-section-header h2 { font-size: 1.2em; margin-bottom: 8px;}
    #planner-controls-toggle-action, #schedule-section-controls-toggle { width: 22px; height: 18px;}
    #planner-controls-toggle-action span, #schedule-section-controls-toggle span { height: 2px; }
    #planner-controls-toggle-action.active span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
    #planner-controls-toggle-action.active span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

    .left-column .planner-main { gap: 15px; padding: 0 15px 10px 15px; }
    .left-column .input-group label, .left-column .slider-group > label { font-size: 0.85em; margin-bottom: 5px;}
    .left-column textarea#task-input, .left-column input[type="text"] { padding: 8px;}
    .left-column .radio-group { padding: 6px;}
    .left-column .radio-group label { margin-right: 8px; font-size: 0.9em;}
    .left-column button#generate-schedule { padding: 8px 15px; font-size: 0.9em;}
    .left-column button.planner-action-button { padding: 6px 12px; font-size: 0.8em; margin-top: 10px;}
    .left-column button#reset-schedule-button.planner-action-button {
        align-self: center;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    .left-column .schedule-info-area .info-icon {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    .left-column .schedule-display { height: 50vh; border-radius: 6px; }
    .left-column .time-slot { min-height: 45px;}
    .left-column .time { flex-basis: 60px; font-size: 0.75em; padding: 4px;}
    .left-column .task-item { padding: 5px 8px; font-size: 0.8em; border-left-width: 2px; min-height: 28px;}
    .left-column .task-break.task-segment-start::before { font-size: 0.85em;}
    .left-column .task-content .task-actions { gap: 5px;}
    .left-column .task-content .task-actions i { font-size: 0.9em; }
    .left-column .task-segment-start .priority-star { font-size: 0.9em;}
    .left-column .task-segment-start .delete-task { width: 14px; height: 14px; font-size: 0.7em; top: -5px; right: -5px;}
    .left-column .task-segment-start .resize-handle { height: 5px; border-width: 1px;}
    .left-column .task-segment-start .resize-handle.top { top: -2.5px;}
    .left-column .task-segment-start .resize-handle.bottom { bottom: -2.5px;}

    #pet-customization-modal .tab-content { max-height: 200px; }
    .forum-header h1 { font-size: 1.6em; }
    .forum-header p { font-size: 0.9em; }
    .create-post h2, .posts h2 { font-size: 1.3em; }


    .modal { padding: 15px; }
    .modal h3, .modal .modal-header h2, .modal-content .modal-header h2 { font-size: 1.2em; margin-bottom: 10px;}
    .modal .modal-buttons { gap: 8px; flex-direction: column;}
    .modal .modal-buttons button { padding: 8px 12px; font-size: 0.9em; width: 100%;}
    #reset-confirm-modal p { font-size: 0.95em; margin-bottom: 15px; }
    #info-box p { font-size: 0.9em; margin-bottom: 8px;}
    #info-box .close-btn { font-size: 1.3em; top: 8px; right: 8px;}

    .right-column { max-width: 100%; }
    .token-display-container { font-size: 1em; padding: 6px 12px;}
    .pet-container { padding: 15px; }
    #pet { width: 300px; }
    .stat-display-wrapper { gap: 5px;}
    .stat-bar-bg { height: 14px;}
    .stat-value { font-size: 0.8em; min-width: 25px;}
    .pet-button { padding: 8px 12px; font-size: 0.85em;}

    .simple-pomodoro-container { padding: 15px; }
    #start-pomodoro-btn { padding: 8px 15px; }
    #pomodoro-overlay-timer { font-size: 5.5em; }
    #pomodoro-stop-btn { font-size: 1em; padding: 8px 15px; margin-top: 1rem; }
    #pomodoro-exit-confirm { width: 95%; padding: 15px; }
    #pomodoro-quote { font-size: 0.95em; margin-bottom: 1rem; }
    .pomodoro-confirm-buttons { flex-direction: column; gap: 0.5rem;}
    .pomodoro-confirm-buttons button { width: 100%;}

    body.has-sidebar .container {
        padding: 10px;
        margin-left: 0;
    }
    .sidebar {
        width: 250px;
        left: -250px;
    }
    .sidebar.active {
        left: 0;
    }
    .sidebar:hover {
        width: 250px;
    }
    .sidebar:hover ~ .container {
        margin-left: 0;
    }
     body.has-sidebar .sidebar.active ~ .container {
        margin-left: 250px;
    }
    .top-right-items { right: 10px; top: 10px; gap: 8px; }
    .top-right-item { padding: 6px 8px; }
    .top-right-items .account-profile img { width: 32px; height: 32px; }


    .forum-header { padding: 10px 0; margin-bottom: 15px; }
    .forum-header h1 { font-size: 1.4em; }
    .forum-header p { font-size: 0.85em; }
    .create-post, .posts { padding: 10px; }
    .create-post h2, .posts h2 { font-size: 1.2em; }
    #post-form textarea { min-height: 80px; font-size: 0.9em; }
    .post-btn { padding: 8px 15px; font-size: 0.9em; }
    .selected-photos img { width: 60px; height: 60px; }
    .post { padding: 10px; }
    .post-author { font-size: 0.9em; }
    .post-time { font-size: 0.75em; }
    .post-content { font-size: 0.9em; }
    .post-actions .like-btn, .post-actions .comment-btn, .post-actions .share-btn { font-size: 0.85em; }
    .add-comment .comment-input { font-size: 0.85em; padding: 6px 8px;}
    .add-comment .comment-submit-btn { font-size: 0.85em; padding: 6px 10px;}

    .group-join-container { padding: 1rem; margin: 1rem auto;}
    .group-join-container h1, .group-join-container h2 { font-size: 1.0rem;  margin-bottom: 1rem; padding-bottom: 0.4rem;} /* 50% smaller */
    .group-join-container h1::after, .group-join-container h2::after { width: 30px; height: 1.5px; }
    .group-join-container .form-group label { font-size: 0.4375rem; margin-bottom: 0.4rem; } /* 50% smaller */
    .group-join-container .form-group input { padding: 0.6rem 0.8rem; font-size: 0.5rem;} /* 50% smaller */
    .group-join-container .join-room-btn { padding: 0.7rem; font-size: 0.5625rem; } /* 50% smaller */


    .chat-container {
        flex-direction: column;
        height: 100vh;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100%;
    }
     body.chat-page .chat-container {
        margin-left: 0;
    }
    .chat-sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .chat-sidebar-header h2 { font-size: 1.0rem; } /* 50% smaller */
    .chat-item { padding: 8px 12px; }
    .chat-item-name { font-size: 0.85rem; } /* 50% smaller */
    .chat-item-last-message { font-size: 0.75rem; } /* 50% smaller */

    .chat-header { padding: 0.6rem 0.8rem; border-radius: 0; }
    .chat-header h2, .chat-header .chat-header-info h3 { font-size: 0.9rem; } /* 50% smaller */
    .leave-room-btn, .settings-toggle { padding: 0.3rem 0.6rem; font-size: 0.7rem;} /* 50% smaller */
    .settings-toggle i { font-size: 0.9rem; } /* 50% smaller */

    .chat-messages { padding: 0.6rem; gap: 0.4rem; }
    .message { padding: 0.5rem 0.75rem; font-size: 0.75rem; } /* 50% smaller */
    .message .username { font-size: 0.7rem; margin-bottom: 0.2rem;} /* 50% smaller */
    .message .time, .message-time { font-size: 0.65rem; margin-top: 0.2rem;} /* 50% smaller */
    .message.system { padding: 0.6rem 0.8rem; font-size: 0.75rem;} /* 50% smaller */

    .chat-input-container { padding: 0.6rem 0.8rem; flex-direction: column;}
    .chat-input-container input { padding: 0.6rem 0.8rem; font-size: 0.75rem;} /* 50% smaller */
    .chat-input-container button { padding: 0.6rem 1rem; font-size: 0.7rem;} /* 50% smaller */


    .settings-panel { width: 100vw; max-width: 100%; right: -100vw;}
    .settings-panel.active { right: 0; }
    .settings-header { padding: 0.8rem; }
    .settings-header h3 { font-size: 1.0rem; } /* 50% smaller */
    .close-settings { font-size: 1.2rem; } /* 50% smaller */
    .settings-content { padding: 0.8rem; }
    .group-avatar { width: 70px; height: 70px; font-size: 1.8rem; }
    .group-name { font-size: 1.1rem; } /* 50% smaller */
    .group-description { font-size: 0.75rem; } /* 50% smaller */
    .settings-item { padding: 0.6rem; }
    .settings-item i { margin-right: 0.6rem; }
    .color-options { grid-template-columns: repeat(3, 1fr); }


    .challenge-container { padding: 10px; }
    .challenge-header h1 { font-size: 1.25em; } /* 50% smaller */
    .challenge-header p { font-size: 0.55em; } /* 50% smaller */
    .challenge-content { grid-template-columns: 1fr; gap: 15px; }
    .challenge-form, .photo-preview { padding: 10px; }
    .challenge-form h2, .photo-preview h2 { font-size: 0.75em; } /* 50% smaller */
    .challenge-form .form-group label { font-size: 0.5rem; } /* 50% smaller */
    .challenge-form .form-group input,
    .challenge-form .form-group textarea { padding: 8px; font-size: 0.5rem; } /* 50% smaller */
    .photo-upload, .photo-capture { padding: 10px; }
    .photo-upload i, .photo-capture i { font-size: 1.0rem; } /* 50% smaller */
    .photo-options { flex-direction: column; }
    .photo-option { padding: 8px; }
    .photo-option i { font-size: 1.1rem; } /* 50% smaller */
    .photo-option p { font-size: 0.45rem; } /* 50% smaller */
    .capture-btn { padding: 6px 12px; font-size: 0.45rem; } /* 50% smaller */
    .submit-btn { padding: 8px 15px; font-size: 0.5rem; } /* 50% smaller */
    .preview-placeholder { padding: 20px; }
    .preview-placeholder i { font-size: 1.5rem; } /* 50% smaller */
    .preview-placeholder p { font-size: 0.55rem; } /* 50% smaller */
    .preview-details { padding: 10px; }
    .preview-details h3 { font-size: 0.6rem; } /* 50% smaller */
    .preview-details p { font-size: 0.45rem; } /* 50% smaller */
    .challenge-content .photo-preview {
        order: 2;
    }
    .challenge-content .challenge-form {
        order: 1;
    }


    body:not(.has-sidebar) .header {
        height: 60px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.2rem 0.5rem;
      }

      .header-left {
        margin-bottom: 0;
      }

      body:not(.has-sidebar) .user-profile,
      body:not(.has-sidebar) .guest-profile {
        flex-direction: row;
        align-items: center;
        gap: 0.2rem;
      }
      body:not(.has-sidebar) .guest-profile .header-auth-button {
        padding: 0.2rem 0.4rem;
        font-size: 0.7em;
    }

      body:not(.has-sidebar) .user-profile button#profile-button,
      body:not(.has-sidebar) #logout-button {
        display: inline-block;
        margin-top: 0;
        padding: 0.15rem 0.25rem;
        font-size: 0.6em;
      }
      body:not(.has-sidebar) #profile-button,
      body:not(.has-sidebar) #logout-button {
          width: auto;
      }

      #username-display {
        display: none;
      }

      body:not(.has-sidebar) {
        padding-top: 0rem;
      }

      body:not(.has-sidebar) .header-logo {
        height: 24px;
        margin-right: 0.1rem;
      }

      body:not(.has-sidebar) .header h1 {
        font-size: 1em;
      }

      .hamburger-button {
          width: 24px;
          height: 18px;
        }
        .hamburger-button span {
          height: 2px;
        }


        .user-profile img#profile-image {
            width: 30px;
            height: 30px;
        }

        body:not(.has-sidebar) .guest-profile {
            flex-direction: row;
            align-items: center;
        }
        .left-column{
            margin-top: 80px;
        }
        .main-container {
            margin-top: 0.3rem;
        }

      #pet-customization-modal .pet-customize-columns {
        flex-direction: column;
        width: 100%;
      }

      #pet-customization-modal {
        padding: 5px;
      }

      #pet-customization-modal .modal-content.pet-customize-content {
        padding: 5px;
      }

      #pet-customization-modal.active .modal-header {
        font-size: 0.9rem;
        padding: 0.3rem;
      }

      .pet-customize-tabs {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
      }

      .tab-button {
        width: auto;
        text-align: center;
        margin: 1px;
        border: solid 1px black;
        flex: 1;
        padding: 3px;
        font-size: 0.6rem;
      }

      .pet-customize-options {
        width: 100%;
        flex-direction: column;
      }

    .tab-content {
        overflow-y: auto;
        max-height: 25vh;
    }

      .pet-color-option img {
        max-width: 30px;
        max-height: 30px;
      }

      .environment-grid {
        gap: 1px;
        grid-template-columns: repeat(3, 1fr);
      }

      .environment-option img {
        max-width: 30px;
        max-height: 30px;
      }

      .pet-customize-preview {
        width: 100%;
        margin-top: 5px;
      }

      .pet-customize-preview .preview-room {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1 / 1;
        position: relative;
        overflow: hidden;
      }

      .pet-color-grid,
      .environment-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)) !important;
      }

      .pet-color-option,
      .environment-option {
          aspect-ratio: 1 / 1;
          width: 100%;
            max-width: 125px;
        }


      #colors-tab h4,
      #environment-tab h4,
      #accessories-tab h4 {
        display: block;
        font-size: 0.8em;
        margin-bottom: 3px;
      }

        .pet-color-grid {
            grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
            gap: 2px;
        }

        .left-column .schedule-display {
            height: 40vh;
        }

        .left-column .time {
          font-size: 0.7em;
        }

          .tab-content {
            padding: 0.5rem !important;
        }
}

.profile-panel { position: fixed; right: -320px; top: var(--header-height); width: 300px; background-color: white; box-shadow: -5px 0 15px rgba(0,0,0,0.1); border-radius: 8px 0 0 8px; z-index: 1000; transition: right 0.3s ease-in-out; overflow: hidden; border-left: 1px solid var(--border-light); }
.profile-panel.active { right: 0; }
.profile-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: linear-gradient(to right, var(--gradient-start), var(--gradient-end)); color: white; }
.profile-panel-header h3 { margin: 0; font-size: 1.2rem; color: white; }
.profile-panel-content { padding: 15px; }
.panel-avatar-container { position: relative; width: 100px; height: 100px; margin: 0 auto 15px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 2px solid var(--primary-accent); box-shadow: var(--shadow-medium); }
.panel-avatar-container img { width: 100%; height: 100%; object-fit: cover; }
.panel-avatar-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; color: white; font-weight: 500; }
.panel-avatar-container:hover .panel-avatar-overlay { opacity: 1; }
.panel-form-group { margin-bottom: 15px; position: relative; }
.panel-form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 0.9em; color: var(--text-medium); }
.panel-form-group input, .panel-form-group textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-medium); border-radius: var(--radius-small); font-size: 14px; box-shadow: var(--shadow-inset); }
.panel-form-group textarea { resize: vertical; min-height: 80px; }
.panel-form-group .char-count { position: absolute; right: 5px; bottom: 5px; font-size: 12px; color: #777; }
.panel-actions { text-align: right; }
.panel-save-button { background: linear-gradient(to right, var(--gradient-start), var(--gradient-end)); color: white; border: none; border-radius: var(--radius-small); padding: 8px 15px; font-weight: 500; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.panel-save-button:hover { transform: translateY(-2px); box-shadow: 0 3px 5px rgba(0,0,0,0.1); }

@media (max-width: 480px) {
    .profile-panel { width: 100%; right: -100%; top: var(--header-height); border-radius: 0; }
    .profile-panel.active { right: 0; }
    .profile-panel-header { padding: 12px; }
    .profile-panel-header h3 { font-size: 1.1rem; }
    .profile-panel-content { padding: 12px; }
    .panel-avatar-container { width: 80px; height: 80px; }
    .panel-form-group input, .panel-form-group textarea { padding: 6px 8px; font-size: 13px; }
    .panel-save-button { padding: 6px 12px; font-size: 0.9em; }
}

#notification-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; align-items: flex-end; }
.notification { background-color: #4CAF50; color: white; padding: 12px 20px; margin-bottom: 10px; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transform: translateX(100%); opacity: 0; transition: all 0.3s ease-in-out; font-family: inherit; }
.notification.success { background-color: #4CAF50; }
.notification.error { background-color: #F44336; }
.notification.info { background-color: #2196F3; }
.notification.show { transform: translateX(0); opacity: 1; }

body.dark-mode {
    background: linear-gradient(to bottom, #303030, #202020);
    color: #f0f0f0;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode label,
body.dark-mode .pet-container h2,
body.dark-mode .simple-pomodoro-container h2,
body.dark-mode #confirm-message,
body.dark-mode #username-display,
body.dark-mode #mood,
body.dark-mode .simple-pomodoro-container .text,
body.dark-mode .pet-container > p {
    color: #ffffff;
}

body.dark-mode .header {
    background-color: #282828;
    border-bottom: 1px solid #404040;
}
body.dark-mode .header .hamburger-button span {
    background-color: #f0f0f0;
}
body.dark-mode #planner-controls-toggle-action span,
body.dark-mode #schedule-section-controls-toggle span {
    background-color: #ffffff;
}
body.dark-mode .left-column .planner-header > h1 {
    color: white;
}
body.dark-mode .planner-controls-header-internal h2 {
    color: var(--primary-accent);
}
body.dark-mode .schedule-section-header h2 {
    color: var(--primary-accent);
}

body.dark-mode .nav-menu {
    background-color: #282828;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}
body.dark-mode .nav-menu .nav-item { color: #f0f0f0; }
body.dark-mode .nav-menu .nav-item:hover { background-color: #383838; color: var(--primary-accent); }

body.dark-mode .sidebar {
    background: #282828;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
    border-right-color: #404040;
}
body.dark-mode .sidebar .sidebar-header {
    border-bottom-color: #404040;
}
body.dark-mode .sidebar .sidebar-header h1 {
    color: #60a5fa;
}
body.dark-mode .sidebar .nav-item {
    color: #ccc;
}
body.dark-mode .sidebar .nav-item:hover {
    background: #383838;
    color: #60a5fa;
}
body.dark-mode .sidebar .nav-item.active {
    background: #303030;
    color: #60a5fa;
    border-left-color: #60a5fa;
}
body.dark-mode .sidebar .nav-item i {
    color: #ccc;
}
body.dark-mode .sidebar .nav-item.active i,
body.dark-mode .sidebar .nav-item:hover i {
    color: #60a5fa;
}
body.dark-mode .top-right-item {
    background: #282828;
    color: #ccc;
}
body.dark-mode .top-right-item:hover {
    background: #383838;
    color: #60a5fa;
}
body.dark-mode .top-right-item i {
    color: #60a5fa;
}
body.dark-mode .top-right-items .account-profile img {
    border-color: #60a5fa;
}


body.dark-mode .left-column { background-color: #333; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
body.dark-mode .left-column .schedule-display {
    background-color: #2a2a2a;
    border: 1px solid #484848;
    scrollbar-color: rgba(180, 180, 180, 0.2) transparent;
}
body.dark-mode .left-column .schedule-display::-webkit-scrollbar-thumb {
    background-color: rgba(180, 180, 180, 0.2);
}
body.dark-mode .left-column .schedule-display:hover::-webkit-scrollbar-thumb {
    background-color: rgba(180, 180, 180, 0.7);
}
body.dark-mode .left-column .schedule-display:hover::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}
body.dark-mode .left-column .schedule-display .current-time-indicator {
    background-color: var(--danger-red); /* Or another high-contrast color for dark mode */
}
body.dark-mode .left-column .schedule-display .current-time-indicator::before {
    background-color: var(--danger-red);
}


body.dark-mode .left-column .time { background-color: #333; color: #bbb; border-right: 1px solid #484848; }
body.dark-mode .left-column textarea#task-input,
body.dark-mode .left-column input[type="text"] { background-color: #404040; color: #eee; border: 1px solid #555; }
body.dark-mode .left-column .input-group label,
body.dark-mode .left-column .slider-group > label { color: #ccc; }
body.dark-mode .left-column .slider-label .slider-value { background-color: #484848; color: var(--primary-accent); }
body.dark-mode .left-column .radio-group { background-color: #383838; border: 1px solid #505050; }
body.dark-mode .left-column .radio-group label { color: #ddd; }
body.dark-mode .left-column .radio-group label:hover { color: var(--primary-accent); }
body.dark-mode .left-column .task-item { background-color: #444; border-left-color: #666; color: #eee; }
body.dark-mode .left-column .task-item.priority {
    background-image: linear-gradient(to bottom right, var(--priority-task-gradient-start), var(--priority-task-gradient-end));
    border-left-color: var(--priority-task-gradient-end);
    color: #111; /* Darker text for better contrast on purple gradient in dark mode */
}
body.dark-mode .left-column .task-item.priority .task-description-text {
    color: #111;
}
body.dark-mode .left-column .task-item.completed:not(.task-break):not(.priority) { background-color: #3a3a3a; border-left-color: #555; color: #999; background-image: none; }
body.dark-mode .left-column .task-item.completed.priority {
    background-image: linear-gradient(to bottom right, var(--priority-task-gradient-start), var(--priority-task-gradient-end));
    opacity: 0.6; color: #222;
}
body.dark-mode .left-column .task-item.completed .task-description-text { color: #888; }
body.dark-mode .left-column .task-item.completed.priority .task-description-text { color: #333; }

body.dark-mode .left-column .task-essay { background-color: #3a4a4a; border-left-color: #527575; }
body.dark-mode .left-column .task-logo { background-color: #4a453a; border-left-color: #756b52; }
body.dark-mode .left-column .task-video { background-color: #3a3a4a; border-left-color: #525275; }
body.dark-mode .left-column .task-break { background-color: #333; border-left-color: #505050; color: #aaa; }
body.dark-mode .left-column .task-break.task-segment-start::before { color: #aaa; }
body.dark-mode .left-column .activity .editable-empty-slot { background-color: #383838; border: 1px dashed #555; color: #999; }
body.dark-mode .left-column .activity .editable-empty-slot:empty::before { color: #777; }
body.dark-mode .left-column .activity .editable-empty-slot:focus { background-color: #484848; border-color: var(--planner-secondary-color); }
body.dark-mode .left-column .schedule-display > .status-message { background-color: rgba(40, 40, 40, 0.95); color: #eee; }
body.dark-mode .left-column .status-error { color: var(--planner-error-color); }
body.dark-mode .left-column .status-loading { color: #ccc; }

body.dark-mode .pet-container,
body.dark-mode .simple-pomodoro-container { background-color: #333; border: 1px solid #484848; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); color: #f0f0f0; }
body.dark-mode .pet-container h2, body.dark-mode .simple-pomodoro-container h2 { color: #fff; }
body.dark-mode .pet-container p:first-of-type { color: #fff; }
body.dark-mode .simple-pomodoro-container .text { color: #ccc; }
body.dark-mode .stat-container label { color: #bbb; }
body.dark-mode .stat-bar-bg { background-color: #484848; border-color: #555; }
body.dark-mode .stat-value { color: #eee; }

body.dark-mode .modal { background-color: #383838; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); color: #f0f0f0; }
body.dark-mode .modal-content { background-color: #404040; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); color: #f0f0f0; }
body.dark-mode #pet-customization-modal .modal-content.pet-customize-content { background-color: #333; }
body.dark-mode #pet-customization-modal .tab-content {
    scrollbar-color: rgba(180, 180, 180, 0.3) transparent;
}
body.dark-mode #pet-customization-modal .tab-content::-webkit-scrollbar-thumb {
    background-color: rgba(180, 180, 180, 0.3);
}
body.dark-mode #pet-customization-modal .tab-content:hover::-webkit-scrollbar-thumb {
    background-color: rgba(180, 180, 180, 0.6);
}
body.dark-mode #pet-customization-modal .tab-button { background-color: #484848; border-color: #555; color: #ddd; }
body.dark-mode #pet-customization-modal .tab-button.active { background-color: var(--info-blue); border-color: var(--info-blue); color: white;}
body.dark-mode #pet-customization-modal .pet-color-option { background: #444;  border: 2px solid #555;  }
body.dark-mode #pet-customization-modal .pet-color-option:hover { border-color: var(--primary-accent); }
body.dark-mode #pet-customization-modal .pet-color-option.selected-color { border-color: var(--primary-accent-hover); box-shadow: 0 0 10px var(--primary-accent-hover); }
body.dark-mode #pet-customization-modal .environment-option { background: #444; border: 2px solid #555; }
body.dark-mode #pet-customization-modal .environment-option:hover { border-color: var(--primary-accent); }
body.dark-mode #pet-customization-modal .environment-option.selected-env { border-color: var(--primary-accent-hover) !important; box-shadow: 0 0 10px var(--primary-accent-hover) !important; }


body.dark-mode .modal h3,
body.dark-mode .modal .modal-header h2,
body.dark-mode .modal-content .modal-header h2 { color: var(--primary-accent); }
body.dark-mode .modal-header { border-bottom: 1px solid #505050; }
body.dark-mode .modal p { color: #ddd; }
body.dark-mode .modal .modal-buttons button.secondary { background-color: #484848; color: #eee; border-color: #606060; }
body.dark-mode .modal .modal-buttons button.secondary:hover { background-color: #555; border-color: #777; }
body.dark-mode #pomodoro-exit-confirm { background-color: rgba(40, 40, 40, 0.95); color: #eee; }
body.dark-mode #pomodoro-quote { color: #bbb; }

body.dark-mode .profile-panel { background-color: #282828; box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5); border-left: 1px solid #404040; color: #f0f0f0; }
body.dark-mode .panel-form-group label { color: #bbb; }
body.dark-mode .panel-form-group input,
body.dark-mode .panel-form-group textarea { background-color: #404040; color: #eee; border: 1px solid #555; }
body.dark-mode .panel-form-group .char-count { color: #888; }

body.dark-mode ::-webkit-scrollbar-track { background: #282828; }
body.dark-mode ::-webkit-scrollbar-thumb { background: #555; border-color: #282828; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: #777; }

body.dark-mode .container {
    background-color: #1e293b;
}
body.dark-mode .forum-header { border-bottom-color: #404040; }
body.dark-mode .forum-header h1 { color: #60a5fa; }
body.dark-mode .forum-header p { color: #9ca3af; }
body.dark-mode .create-post, body.dark-mode .posts { background-color: #282828;  border-color: #404040; }
body.dark-mode .create-post h2, body.dark-mode .posts h2 { color: #eee; border-bottom-color: #404040; }
body.dark-mode #post-form textarea { background-color: #333; color: #eee; border-color: #555; }
body.dark-mode #post-form textarea:focus { border-color: #60a5fa; box-shadow: 0 0 0 2px rgba(96,165,250,0.35);  }
body.dark-mode .photo-upload-container .photo-upload-btn { background-color: #333; color: #60a5fa; border-color: #60a5fa; }
body.dark-mode .photo-upload-container .photo-upload-btn:hover { background-color: #404040; }
body.dark-mode #posts-container .post { background-color: #303030; border-color: #484848; }
body.dark-mode .post-author { color: #e0e0e0; }
body.dark-mode .post-time { color: #aaa; }
body.dark-mode .post-content { color: #ccc; }
body.dark-mode .post-actions { border-top-color: #484848; }
body.dark-mode .post-actions .like-btn, body.dark-mode .post-actions .comment-btn, body.dark-mode .post-actions .share-btn { color: #bbb; }
body.dark-mode .post-actions .like-btn:hover, body.dark-mode .post-actions .comment-btn:hover, body.dark-mode .post-actions .share-btn:hover { color: #60a5fa; }
body.dark-mode .comments-section { border-top-color: #484848; }
body.dark-mode .comments-list .comment { border-bottom-color: #404040; }
body.dark-mode .comments-list .comment-author { color: #e0e0e0; }
body.dark-mode .comments-list .comment-text { color: #bbb; }
body.dark-mode .add-comment .comment-input { background-color: #333; color: #eee; border-color: #555; }

body.dark-mode .group-join-container { background: #282828; border-color: #404040; }
body.dark-mode .group-join-container h1, body.dark-mode .group-join-container h2 { color: #eee; }
body.dark-mode .form-group label { color: #bbb; }
body.dark-mode .form-group input { background-color: #333; color: #eee; border-color: #555; }
body.dark-mode .form-group input:focus { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(96,165,250,0.1); }
body.dark-mode .chat-container { background: #1e293b;  }
body.dark-mode .chat-sidebar { background: #282828; border-right-color: #404040;}
body.dark-mode .chat-sidebar-header { border-bottom-color: #404040;}
body.dark-mode .chat-sidebar-header h2 { color: #eee; }
body.dark-mode .chat-item:hover { background: #383838; }
body.dark-mode .chat-item.active { background: #303030; }
body.dark-mode .chat-item-name { color: #eee; }
body.dark-mode .chat-item-last-message { color: #aaa; }
body.dark-mode .chat-header .chat-header-info h3 { color: #eee; }
body.dark-mode .chat-messages { background: linear-gradient(135deg, #1e293b 0%, #111827 100%); }
body.dark-mode .message.received { background: #333; color: #eee; }
body.dark-mode .chat-input-container { background: #282828; border-top-color: #404040; }
body.dark-mode .chat-input-container input, body.dark-mode .chat-input-field { background-color: #333; color: #eee; border-color: #555;}
body.dark-mode .chat-input-container input:focus, body.dark-mode .chat-input-field:focus { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(96,165,250,0.1); }
body.dark-mode .message.system { background: #4b5563; color: #f3f4f6; }
body.dark-mode .chat-empty-state { color: #9ca3af;}
body.dark-mode .chat-empty-state i { color: #4b5563;}
body.dark-mode .settings-panel { background: #282828; }
body.dark-mode .settings-section h4 { color: #9ca3af; }
body.dark-mode .settings-item:hover { background-color: #374151; }
body.dark-mode .settings-item i { color: #9ca3af; }
body.dark-mode .settings-item span { color: #f3f4f6; }
body.dark-mode .settings-item .arrow { color: #9ca3af; }
body.dark-mode .group-info { border-bottom-color: #404040; }
body.dark-mode .group-name { color: #f3f4f6; }
body.dark-mode .group-description { color: #9ca3af; }
body.dark-mode .customization-modal .modal-content { background: #333; }
body.dark-mode .customization-modal .modal-header { border-bottom-color: #404040; }
body.dark-mode .color-option.active { border-color: #f3f4f6; }
body.dark-mode .member-item:hover { background-color: #374151; }
body.dark-mode .member-name { color: #f3f4f6; }
body.dark-mode .member-role { color: #9ca3af; }
body.dark-mode .member-action-btn { color: #9ca3af; }
body.dark-mode .member-action-btn:hover { background-color: #4b5563; color: #f3f4f6; }

body.dark-mode .challenge-header h1 { color: #eee; }
body.dark-mode .challenge-header p { color: #bbb; }
body.dark-mode .challenge-form, body.dark-mode .photo-preview { background: #282828; }
body.dark-mode .challenge-form h2, body.dark-mode .photo-preview h2 { color: #eee; }
body.dark-mode .challenge-form .form-group label { color: #bbb; }
body.dark-mode .challenge-form .form-group input, body.dark-mode .challenge-form .form-group textarea { background: #333; color: #eee; border-color: #555; }
body.dark-mode .challenge-form .form-group input:focus, body.dark-mode .challenge-form .form-group textarea:focus { border-color: #60a5fa; }
body.dark-mode .photo-upload, body.dark-mode .photo-capture { border-color: #555; }
body.dark-mode .photo-upload:hover, body.dark-mode .photo-capture:hover { border-color: #60a5fa; background: #383838; }
body.dark-mode .photo-upload i, body.dark-mode .photo-capture i { color: #bbb; }
body.dark-mode .photo-upload p, body.dark-mode .photo-capture p { color: #bbb; }
body.dark-mode .photo-option { border-color: #555; }
body.dark-mode .photo-option:hover { border-color: #60a5fa; background: #383838; }
body.dark-mode .photo-option.active { border-color: #60a5fa; background: #303030; }
body.dark-mode .photo-option i, body.dark-mode .photo-option p { color: #bbb; }
body.dark-mode .preview-placeholder { color: #bbb; border-color: #555; }
body.dark-mode .preview-placeholder i { color: #555; }
body.dark-mode .preview-details { background: #333; }
body.dark-mode .preview-details h3 { color: #eee; }
body.dark-mode .preview-details p { color: #bbb; }

#login-prompt-overlay .modal-content {
    max-width: 500px;
    width: auto;
    padding: 20px;
    height: auto;
    max-height: none;
    transform: none;
}


body.dark-mode #login-prompt-overlay .modal-content {
    background-color: #444;
    color: #ddd;
}

body.dark-mode #login-prompt-overlay p,
body.dark-mode #login-prompt-overlay h2 {
    color: #ccc;
}

@media (max-width: 768px) {
    #login-prompt-overlay .modal-content {
        width: 90%;
        margin: 10px;
    }

    #login-prompt-overlay .prompt-buttons {
        flex-direction: column;
        gap: 5px;
    }

    .pet-customize-preview .preview-room {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
  }
  .pet-customize-options {
    width: 100%;
    flex-direction: column;
  }
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

@media (max-width: 480px) {

  body:not(.has-sidebar) .header {
    height: 60px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0.5rem;
  }

  .header-left {
    margin-bottom: 0;
  }

  body:not(.has-sidebar) .user-profile,
  body:not(.has-sidebar) .guest-profile {
    flex-direction: row;
    align-items: center;
    gap: 0.2rem;
  }
  body:not(.has-sidebar) .guest-profile .header-auth-button {
    padding: 0.2rem 0.4rem;
    font-size: 0.7em;
}

  body:not(.has-sidebar) .user-profile button#profile-button,
  body:not(.has-sidebar) #logout-button {
    display: inline-block;
    margin-top: 0;
    padding: 0.15rem 0.25rem;
    font-size: 0.6em;
  }
  body:not(.has-sidebar) #profile-button,
  body:not(.has-sidebar) #logout-button {
      width: auto;
  }

  #username-display {
    display: none;
  }

  body:not(.has-sidebar) {
    padding-top: 0rem;
  }

  body:not(.has-sidebar) .header-logo {
    height: 24px;
    margin-right: 0.1rem;
  }

  body:not(.has-sidebar) .header h1 {
    font-size: 1em;
  }

  .hamburger-button {
      width: 24px;
      height: 18px;
    }
    .hamburger-button span {
      height: 2px;
    }


    .user-profile img#profile-image {
        width: 30px;
        height: 30px;
    }

    body:not(.has-sidebar) .guest-profile {
        flex-direction: row;
        align-items: center;
    }
    .left-column{
        margin-top: 80px;
    }
    .main-container {
        margin-top: 0.3rem;
    }

  #pet-customization-modal .pet-customize-columns {
    flex-direction: column;
    width: 100%;
  }

  #pet-customization-modal {
    padding: 5px;
  }

  #pet-customization-modal .modal-content.pet-customize-content {
    padding: 5px;
  }

  #pet-customization-modal.active .modal-header {
    font-size: 0.9rem;
    padding: 0.3rem;
  }

  .pet-customize-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .tab-button {
    width: auto;
    text-align: center;
    margin: 1px;
    border: solid 1px black;
    flex: 1;
    padding: 3px;
    font-size: 0.6rem;
  }

  .pet-customize-options {
    width: 100%;
    flex-direction: column;
  }

.tab-content {
    overflow-y: auto;
    max-height: 25vh;
}

  .pet-color-option img {
    max-width: 30px;
    max-height: 30px;
  }

  .environment-grid {
    gap: 1px;
    grid-template-columns: repeat(3, 1fr);
  }

  .environment-option img {
    max-width: 30px;
    max-height: 30px;
  }

  .pet-customize-preview {
    width: 100%;
    margin-top: 5px;
  }

  .pet-customize-preview .preview-room {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
  }

  .pet-color-grid,
  .environment-grid {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)) !important;
  }

  .pet-color-option,
  .environment-option {
      aspect-ratio: 1 / 1;
      width: 100%;
        max-width: 125px;
    }


  #colors-tab h4,
  #environment-tab h4,
  #accessories-tab h4 {
    display: block;
    font-size: 0.8em;
    margin-bottom: 3px;
  }

    .pet-color-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 2px;
    }

    .left-column .schedule-display {
        height: 40vh;
    }

    .left-column .time {
      font-size: 0.7em;
    }

      .tab-content {
        padding: 0.5rem !important;
    }
}