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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
}

/* Main Header */
.main-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 15px 20px;
    border-bottom: 3px solid #e74c3c;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.main-header h1 {
    color: #ecf0f1;
    font-size: 1.8em;
    margin: 0;
    font-weight: 500;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-info {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    padding: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-info:hover {
    transform: scale(1.2);
    filter: brightness(1.2);
}

/* Timer Section */
.timer-section {
    padding: 40px 20px;
    text-align: center;
    background-color: #1a1a1a;
}

.timer-and-stats {
    display: flex;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    align-items: flex-start;
}

.timer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.timer-display {
    font-size: 4.5em;
    font-weight: bold;
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
    padding: 20px 40px;
    border-radius: 15px;
    min-width: 300px;
    text-align: center;
    font-family: 'Courier New', monospace;
    border: 2px solid rgba(52, 152, 219, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.timer-controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #27ae60;
    color: white;
}

.btn-primary:hover {
    background-color: #229954;
}

.btn-secondary {
    background-color: #f39c12;
    color: white;
}

.btn-secondary:hover {
    background-color: #e67e22;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-nav {
    background-color: #3498db;
    color: white;
    padding: 8px 15px;
}

.btn-nav:hover {
    background-color: #2980b9;
}

.btn-toggle {
    background-color: #16a085;
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    margin-left: 10px;
}

.btn-toggle:hover {
    background-color: #138d75;
}

.today-stats {
    color: #bdc3c7;
    font-size: 1.1em;
}

/* Practice Stats */
.practice-stats {
    flex: 1;
    background: rgba(52, 73, 94, 0.3);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    min-width: 300px;
}

.practice-stats h3 {
    color: #ecf0f1;
    margin: 0 0 20px 0;
    font-size: 1.4em;
    text-align: center;
    border-bottom: 2px solid rgba(52, 152, 219, 0.3);
    padding-bottom: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item:has(#lessonsPerDay) {
    border-bottom: none;
}

.stat-label {
    color: #bdc3c7;
    font-size: 0.95em;
    font-weight: 500;
}

.stat-value {
    color: #3498db;
    font-size: 1.1em;
    font-weight: bold;
    text-align: right;
}

/* Practice Stats Separator */
.practice-stats .stats-separator {
    border: 0;
    height: 1px;
    background: rgba(52, 152, 219, 0.3);
    margin: 20px 0 15px 0;
}

.practice-stats h4 {
    color: #ecf0f1;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    text-align: center;
    font-weight: 500;
}

/* Authentication Section */
.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

#authContainer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-auth {
    background-color: #4285f4;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-auth:hover {
    background-color: #357ae8;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ecf0f1;
}

.user-name {
    color: #ecf0f1;
    font-size: 14px;
    font-weight: 500;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #95a5a6;
}

.btn-sync {
    background-color: #16a085;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
}

.btn-sync:hover {
    background-color: #138d75;
}

.sync-status.syncing #syncStatusText {
    color: #f39c12;
}

.sync-status.error #syncStatusText {
    color: #e74c3c;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
}

.main-content .timer-section {
    width: 100%;
}

.content-below-timer {
    display: flex;
    padding: 20px;
    gap: 30px;
}

/* Sidebar */
.sidebar {
    flex: 1;
    min-width: 350px;
    background-color: #2c3e50;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    height: fit-content;
}

.course-progress h2 {
    color: #ecf0f1;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.overall-progress {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #34495e;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    transition: width 0.3s ease;
    width: 0%;
}

#progressText {
    color: #bdc3c7;
    font-size: 0.9em;
}

/* Modules */
.module {
    background-color: #34495e;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.module-header {
    padding: 15px;
    background-color: #2c3e50;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.module-header:hover {
    background-color: #1a252f;
}

.module-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #ecf0f1;
}

.module-duration {
    color: #95a5a6;
    font-size: 0.9em;
}

.module-progress {
    font-size: 0.8em;
    color: #27ae60;
}

.module-content {
    padding: 15px;
    display: none;
}

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

.lesson-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #3a4a5c;
}

.lesson-item:last-child {
    border-bottom: none;
}

.lesson-checkbox {
    margin-right: 10px;
    transform: scale(1.2);
}

.lesson-name {
    color: #ecf0f1;
    font-size: 0.9em;
}

.lesson-item.completed .lesson-name {
    text-decoration: line-through;
    color: #95a5a6;
}

.select-all-item {
    background-color: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 4px;
    margin-bottom: 8px;
    padding: 8px 12px !important;
}

.select-all-label {
    font-weight: bold;
    color: #3498db !important;
    font-style: italic;
}

.select-all-checkbox {
    margin-right: 10px;
    transform: scale(1.3);
}

.select-all-checkbox:indeterminate {
    opacity: 0.6;
}

/* Calendar Section */
.calendar-section {
    flex: 2;
    background-color: #2c3e50;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    color: #ecf0f1;
    font-size: 1.8em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #34495e;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    color: #ecf0f1;
    padding: 2px;
}

.date-number {
    font-weight: bold;
    line-height: 1;
}

.practice-minutes {
    font-size: 0.7em;
    color: #bdc3c7;
    margin-top: 2px;
    line-height: 1;
}

.calendar-day:hover {
    background-color: #3a4a5c;
}

.calendar-day.today {
    background-color: #e74c3c;
    color: white;
    font-weight: bold;
}


.calendar-day.target-date {
    background-color: #9b59b6;
    color: white;
    animation: pulse 2s infinite;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day-header {
    background-color: #2c3e50;
    color: #bdc3c7;
    font-weight: bold;
    font-size: 0.8em;
    cursor: default;
}

.calendar-day-header:hover {
    background-color: #2c3e50;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    color: #bdc3c7;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

/* Gradient Legend Styles */
.gradient-legend {
    align-items: center;
}

.legend-label {
    font-size: 0.9em;
    color: #bdc3c7;
}

.gradient-bar {
    width: 120px;
    height: 15px;
    background: linear-gradient(90deg,
            hsl(120, 40%, 85%) 0%,
            hsl(120, 55%, 55%) 50%,
            hsl(120, 70%, 25%) 100%);
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.gradient-start,
.gradient-end {
    font-size: 0.7em;
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.legend-color.target-date {
    background-color: #9b59b6;
}

/* Yearly Chart Styles */
/* Dark Reader: Please preserve these colors for the contribution chart */
:root {
    --darkreader-inline-bgcolor: #2c3e50;
    --darkreader-inline-color: #ecf0f1;
}

[data-darkreader-inline-bgcolor] .yearly-chart-day {
    background-color: var(--darkreader-inline-bgcolor) !important;
}

.yearly-chart-section {
    -webkit-filter: none !important;
    filter: none !important;
}
.yearly-chart-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #34495e !important;
    background-color: transparent !important;
}

.yearly-chart-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.yearly-chart-header h3 {
    color: #ecf0f1 !important;
    font-size: 1.4em;
    margin: 0;
}

.yearly-chart-container {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    margin-bottom: 15px;
    background-color: transparent !important;
}

.yearly-chart-months {
    display: grid !important;
    grid-template-columns: repeat(53, 12px) !important;
    gap: 2px;
    margin-bottom: 8px;
    margin-left: 20px;
}

.yearly-chart-month {
    font-size: 0.8em;
    color: #95a5a6 !important;
    text-align: left;
}

.yearly-chart-grid {
    display: grid !important;
    grid-template-columns: repeat(53, 12px) !important;
    grid-template-rows: repeat(7, 12px) !important;
    gap: 2px;
    margin-left: 20px;
    grid-auto-flow: column;
}

.yearly-chart-day {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background-color: #2c3e50; /* Default - can be overridden by inline styles */
    cursor: pointer;
    transition: all 0.1s ease;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.yearly-chart-day:hover {
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.yearly-chart-day.future {
    opacity: 0.3;
    cursor: default;
}

.yearly-chart-day.future:hover {
    transform: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Practice intensity levels */
.yearly-chart-day.level-0 {
    background-color: #2c3e50 !important;
}

.yearly-chart-day.target-date {
    background-color: #9b59b6 !important;
    animation: pulse 2s infinite;
}

/* Level classes removed - now using dynamic HSL colors */

/* Yearly chart legend styles removed - legend moved to bottom */

/* Dynamic legend color classes */
.legend-level-1 {
    background-color: hsl(120, 40%, 85%) !important;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-level-2 {
    background-color: hsl(120, 55%, 55%) !important;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-level-3 {
    background-color: hsl(120, 70%, 40%) !important;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-level-4 {
    background-color: hsl(120, 70%, 25%) !important;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tooltip for yearly chart */
.yearly-chart-tooltip {
    position: absolute;
    background: #34495e;
    color: #ecf0f1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    border: 1px solid #4a5f7a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.yearly-chart-tooltip.show {
    opacity: 1;
}

.yearly-chart-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #34495e;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .timer-container {
        flex-direction: column;
        text-align: center;
    }

    .timer-container h1 {
        font-size: 2em;
        margin-bottom: 15px;
    }

    .timer-display {
        font-size: 2.5em;
    }

    .main-content {
        flex-direction: column;
        padding: 15px;
    }

    .sidebar {
        min-width: auto;
    }

    .calendar-grid {
        gap: 1px;
    }

    .calendar-day {
        font-size: 0.8em;
    }

    .calendar-legend {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .timer-controls {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        padding: 8px 15px;
        font-size: 14px;
    }

    .calendar-legend {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .gradient-legend {
        align-items: center;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #2c3e50;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #34495e;
}

.modal-header h3 {
    margin: 0;
    color: #ecf0f1;
    font-size: 1.4em;
}

.modal-close {
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #e74c3c;
    color: white;
}

.modal-body {
    padding: 25px;
}

.modal-body p {
    margin: 0 0 20px 0;
    color: #bdc3c7;
    font-size: 1.1em;
    font-weight: 500;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #ecf0f1;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #34495e;
    border-radius: 6px;
    background-color: #34495e;
    color: #ecf0f1;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
}

.modal-hint {
    color: #95a5a6;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.modal-error {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    display: none;
}

.modal-error.show {
    display: block;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #34495e;
}

.modal-footer .btn {
    padding: 10px 20px;
    font-size: 14px;
}

/* Info Modal Specific Styles */
.modal-info {
    max-width: 600px;
    max-height: 80vh;
}

.modal-info .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.modal-info h1 {
    color: #3498db;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.modal-info h2 {
    color: #27ae60;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.modal-info h3 {
    color: #f39c12;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.modal-info p {
    color: #bdc3c7;
    margin-bottom: 15px;
    line-height: 1.6;
}

.modal-info strong {
    color: #ecf0f1;
}

.modal-info code {
    background-color: #34495e;
    color: #e74c3c;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.modal-info ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal-info li {
    color: #bdc3c7;
    margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .main-header h1 {
        font-size: 1.5em;
    }

    .auth-section {
        align-items: center;
    }

    .timer-section {
        padding: 30px 15px;
    }

    .timer-and-stats {
        flex-direction: column;
        align-items: stretch;
        gap: 30px;
    }

    .timer-display {
        font-size: 3.5em;
        padding: 15px 30px;
        min-width: 250px;
    }

    .timer-content {
        gap: 15px;
    }

    .practice-stats {
        min-width: auto;
        padding: 20px;
        width: 100%;
    }

    .content-below-timer {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
    }

    .sidebar {
        order: 2;
    }

    .calendar-section {
        order: 1;
    }

    .calendar-legend {
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .legend-item {
        justify-content: center;
        align-items: center;
    }

    .auth-section {
        justify-content: center;
        width: 100%;
    }

    /* Yearly Chart Mobile */
    .yearly-chart-grid {
        grid-template-columns: repeat(53, 10px) !important;
        grid-template-rows: repeat(7, 10px) !important;
        gap: 1px !important;
    }

    .yearly-chart-day {
        width: 10px !important;
        height: 10px !important;
    }

    .yearly-chart-months {
        margin-left: 16px;
    }

    .yearly-chart-month {
        min-width: 42px;
        font-size: 0.7em;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 10px 15px;
    }

    .main-header h1 {
        font-size: 1.3em;
    }

    .timer-section {
        padding: 20px 10px;
    }

    .timer-and-stats {
        flex-direction: column;
        gap: 25px;
    }

    .timer-display {
        font-size: 2.8em;
        padding: 12px 25px;
        min-width: 200px;
    }

    .practice-stats {
        padding: 15px;
    }

    .practice-stats h3 {
        font-size: 1.2em;
    }

    .stat-item {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }

    .stat-value {
        text-align: center;
    }

    .timer-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .timer-controls .btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .user-info {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    /* Modal Responsive */
    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px 20px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Yearly Chart Smallest Mobile */
    .yearly-chart-grid {
        grid-template-columns: repeat(53, 8px) !important;
        grid-template-rows: repeat(7, 8px) !important;
        gap: 1px !important;
        margin-left: 12px;
    }

    .yearly-chart-day {
        width: 8px !important;
        height: 8px !important;
    }

    .yearly-chart-months {
        margin-left: 12px;
    }

    .yearly-chart-month {
        min-width: 34px;
        font-size: 0.6em;
    }

    .yearly-chart-section {
        margin-top: 20px;
        padding-top: 15px;
    }

    /* Yearly chart legend mobile styles removed */
}