/* Custom Properties */
:root {
    --bg-color: #F8FAFC;
    --surface-color: #FFFFFF;
    --primary-color: #2563EB;
    --primary-hover: #1D4ED8;
    --accent-color: #0D9488;
    --accent-hover: #0F766E;
    --text-dark: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --error-bg: #FEF2F2;
    --error-text: #B91C1C;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Prevent long words/formulas from breaking the layout */
img {
    max-width: 100%;
    height: auto;
}

.hidden {
    display: none !important;
}

/* Header */
.app-header {
    background-color: var(--text-dark);
    color: white;
    padding: 1.5rem 2rem;
    padding-top: calc(1.5rem + env(safe-area-inset-top));
    text-align: center;
}

.app-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.app-header .tagline {
    color: #94A3B8;
    font-size: 0.9rem;
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
    padding-left: calc(2rem + env(safe-area-inset-left));
    padding-right: calc(2rem + env(safe-area-inset-right));
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Control Panel */
.control-panel {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 2rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius);
}

.icon-btn:hover {
    color: var(--text-dark);
    background: var(--bg-color);
}

/* Mobile drawer + FAB: hidden on desktop */
.panel-close-btn,
.fab {
    display: none;
}

.saved-topics-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.saved-topic {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    overflow: hidden;
}

.saved-topic-btn {
    flex: 1;
    text-align: left;
    background: none;
    border: none;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    color: var(--text-dark);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-topic-btn:hover {
    color: var(--primary-color);
}

.saved-topic-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0.5rem 0.75rem;
}

.saved-topic-delete:hover {
    color: var(--error-text);
}

.no-saved {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.5rem;
    list-style: none;
}

.panel-section {
    margin-bottom: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

textarea,
select,
input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    background-color: var(--surface-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

textarea:focus,
select:focus,
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.preset-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: var(--border-color);
    color: var(--text-dark);
}

/* Buttons */
.panel-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.primary-btn,
.secondary-btn,
.accent-btn {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.1s;
    border: none;
    width: 100%;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

.primary-btn.outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.primary-btn.outline:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.secondary-btn {
    background-color: var(--bg-color);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.secondary-btn:hover {
    background-color: var(--border-color);
}

.accent-btn {
    background-color: var(--accent-color);
    color: white;
}

.accent-btn:hover {
    background-color: var(--accent-hover);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Content Area */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface-color);
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 1rem;
    color: var(--border-color);
}

.empty-state h2 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Error Alert */
.alert.error {
    background-color: var(--error-bg);
    color: var(--error-text);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid #FCA5A5;
}

.alert.success {
    background-color: #F0FDF4;
    color: #166534;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid #86EFAC;
}

/* Loading State */
.loading-container {
    text-align: center;
    padding: 3rem;
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* Rotating fun facts / study tips during generation */
#loading-tip {
    max-width: 440px;
    margin: 0 auto;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#loading-tip.visible {
    opacity: 1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Questions Output */
.questions-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.question-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.question-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.question-text {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 1rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.options-list {
    list-style: none;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    transition: background-color 0.2s, border-color 0.2s;
    overflow: hidden;
}

.option-item:hover {
    background-color: var(--border-color);
}

.option-item:has(input[type="radio"]:checked) {
    background-color: #EFF6FF;
    border-color: var(--primary-color);
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.option-label input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.option-item.correct {
    background-color: #F0FDF4;
    /* Light green */
    border-color: #22C55E;
}

.option-item.correct .option-text {
    color: #166534;
    font-weight: 500;
}

.option-item.incorrect {
    background-color: #FEF2F2;
    /* Light red */
    border-color: #EF4444;
}

.option-item.incorrect .option-text {
    color: #991B1B;
    font-weight: 500;
}

.interactive-area {
    margin-top: 1rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 1rem;
}

.interactive-area textarea {
    margin-bottom: 1rem;
}

.solution-container {
    background-color: #F0FDFA;
    /* Light teal tint */
    border-top: 1px solid #CCFBF1;
    display: none;
    /* Hidden initially */
}

.solution-container.visible {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.solution-header {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.solution-content {
    padding: 0 1.5rem 1.5rem;
}

/* Distractor Analysis */
.distractor-analysis {
    border-top: 1px solid #CCFBF1;
    padding: 1rem 1.5rem 1.5rem;
}

.da-title {
    font-size: 0.95rem;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
}

.da-loading,
.da-error {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.da-error {
    color: var(--error-text);
}

.da-correct {
    background: #FFFFFF;
    border: 1px solid #CCFBF1;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.da-item {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.da-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.da-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.da-trap {
    background: #EFF6FF;
    color: var(--primary-color);
    border: 1px solid #BFDBFE;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    text-transform: capitalize;
}

.da-reason {
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-top: 0.3rem;
}

.da-skill,
.da-tip {
    font-size: 0.85rem;
    color: var(--text-dark);
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    margin-top: 0.75rem;
}

/* Markdown Styles within outputs */
.markdown-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin: 1.5em 0 0.5em;
    line-height: 1.25;
}

.markdown-body p {
    margin-bottom: 1em;
}

.markdown-body ul,
.markdown-body ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.markdown-body code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
}

.markdown-body pre {
    background-color: #1E293B;
    color: #F8FAFC;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1em;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* ===== Responsive: mobile-first overrides (keep at end so they win the cascade) ===== */

/* Panel backdrop (mobile only) */
.panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 950;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Floating button to open the input drawer (mobile only) */
.fab {
    position: fixed;
    right: 1.25rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    z-index: 960;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
}

.fab:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 1rem;
        padding-left: calc(1rem + env(safe-area-inset-left));
        padding-right: calc(1rem + env(safe-area-inset-right));
    }

    /* Input panel becomes a slide-in drawer */
    .control-panel {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 340px);
        margin: 0;
        border-radius: 0;
        border-right: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-105%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .control-panel.open {
        transform: translateX(0);
    }

    .panel-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .app-header {
        padding: 1.25rem 1rem;
        padding-top: calc(1.25rem + env(safe-area-inset-top));
    }

    .post-actions {
        justify-content: stretch;
    }

    .post-actions .primary-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .app-header h1 {
        font-size: 1.25rem;
    }

    .question-header {
        padding: 1rem;
    }

    .solution-content {
        padding: 0 1rem 1rem;
    }

    .distractor-analysis {
        padding: 1rem 1rem 1.25rem;
    }

    .solution-header {
        padding: 0.75rem 1rem;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .panel-section {
        margin-bottom: 1.25rem;
    }

    .control-panel {
        padding: 1.25rem;
    }
}

/* Touch-friendly controls on coarse pointers */
@media (pointer: coarse) {
    .primary-btn,
    .secondary-btn,
    .accent-btn {
        min-height: 48px;
        font-size: 1rem;
    }

    textarea,
    select,
    input {
        font-size: 16px;
    }

    .option-label {
        padding: 0.75rem 0.75rem;
    }

    .option-label input[type="radio"] {
        width: 1.5rem;
        height: 1.5rem;
    }

    .preset-btn {
        padding: 0.5rem 0.9rem;
    }
}

/* ===== Adaptive Learning UI (Phases 3-4) ===== */

.field-optional {
    font-weight: 400;
    color: var(--text-muted);
}

.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Source material file / image upload */
.source-file-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary, #4361ee);
    background: rgba(67, 97, 238, 0.08);
    border: 1px dashed var(--primary, #4361ee);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.file-upload-btn:hover {
    background: rgba(67, 97, 238, 0.15);
}

.source-file-name {
    font-size: 0.8rem;
    color: var(--text-dark);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-file-clear {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}

.source-file-clear:hover {
    color: var(--danger, #e63946);
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.65rem 0.75rem;
}

.checkbox-wrap input {
    width: auto;
    margin: 0;
}

/* Question top row (share button + timed badge) */
.question-top-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.question-top-row .question-text {
    flex: 1;
    margin-bottom: 0;
}

.timed-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
    border-radius: 99px;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.timed-badge .timed-countdown.danger {
    color: #DC2626;
}

.share-card-btn {
    flex-shrink: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.share-card-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.share-card-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Confidence rating */
.confidence-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.confidence-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.confidence-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface-color);
    transition: all 0.2s;
}

.confidence-option:hover {
    border-color: #CBD5E1;
}

.confidence-option input {
    width: auto;
    margin: 0;
}

.confidence-option:has(input:checked) {
    background: #EFF6FF;
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* Diff highlighting for regenerated variations */
.highlight-diff {
    background: #FEF08A;
    color: #854D0E;
    border-radius: 3px;
    padding: 0 0.15em;
    font-weight: 600;
}

/* Answer evaluation status (short answer / essay) */
.eval-status {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.eval-status.correct {
    color: #16A34A;
}

.eval-status.incorrect {
    color: #DC2626;
}

.eval-status.error {
    color: var(--text-muted);
}

/* Teacher Mode print stylesheet */
@media print {
    body * {
        visibility: hidden;
    }

    #print-area,
    #print-area * {
        visibility: visible;
    }

    #print-area {
        position: absolute;
        inset: 0;
        width: 100%;
        padding: 1rem;
    }

    #print-area .print-header {
        margin-bottom: 1.5rem;
        text-align: center;
    }

    #print-area .print-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    #print-area .print-header p {
        color: var(--text-muted);
        font-size: 0.85rem;
    }

    #print-area .question-card {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    #print-area .print-answer-key {
        margin-top: 2rem;
        page-break-before: always;
    }

    #print-area .print-answer-key h2 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    #print-area .print-answer-key li {
        margin-bottom: 0.35rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .post-actions .secondary-btn {
        width: 100%;
    }
}

/* ==========================================
   Floating Focus Timer
   ========================================== */
.floating-timer {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 100;
}

.timer-toggle-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.timer-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.floating-timer.timer-done .timer-toggle-btn {
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    color: #DC2626; /* Error/Red color for done */
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.timer-panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 320px;
    position: absolute;
    bottom: 0;
    left: 0;
    transform-origin: bottom left;
    animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.timer-panel.hidden,
.timer-toggle-btn.hidden {
    display: none !important;
}

.timer-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.timer-panel-header h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-dark);
}

.timer-display-large {
    font-size: 3.5rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--primary-color);
    margin: 1rem 0 2rem;
    letter-spacing: -1px;
}

.timer-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.time-input-group input {
    width: 3.5rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-dark);
}

.time-input-group label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.timer-actions {
    display: flex;
    gap: 0.75rem;
}

.timer-actions button {
    flex: 1;
}

/* Make UI bigger on PC */
@media (min-width: 1024px) {
    html {
        font-size: 115%;
    }
}