/* Panels & Overlays - INSPIRED */
/* All modal, overlay, and panel styles */

/* =============================================
   BASE OVERLAY STYLES
   ============================================= */
.stats-overlay,
.inbox-overlay,
.shortcuts-overlay,
.edit-overlay,
.news-overlay,
.tetris-overlay,
.quiz-overlay,
.wallpaper-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(61, 61, 61, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: overlayFadeIn 0.3s ease;
}

.stats-overlay.active,
.inbox-overlay.active,
.shortcuts-overlay.active,
.edit-overlay.active,
.news-overlay.active,
.tetris-overlay.active,
.quiz-overlay.active,
.wallpaper-overlay.active {
    display: flex;
}

/* =============================================
   STATS MODAL
   ============================================= */
.stats-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.stats-header h2 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

#stats-content {
    display: grid;
    gap: var(--space-md);
}

.stat-card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
}

.stat-value {
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================
   ARCHIVE MODAL
   ============================================= */
.archive-modal {
    max-width: 700px;
}

#archive-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.archive-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition-normal);
}

.archive-item:hover {
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.archive-item-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
}

.archive-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: var(--space-md);
}

/* =============================================
   INBOX OVERLAY (Superhuman Style)
   ============================================= */
.superhuman-inbox {
    display: flex;
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.inbox-sidebar {
    width: 380px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
}

.inbox-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.inbox-sidebar-header h2 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.inbox-header-actions {
    display: flex;
    gap: var(--space-sm);
}

.inbox-action-btn {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    cursor: pointer;
    transition: var(--transition-normal);
    font-size: 1rem;
}

.inbox-action-btn:hover {
    background: var(--lavender-light);
    border-color: var(--lavender);
}

.inbox-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.inbox-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    border: 1px solid transparent;
    margin-bottom: var(--space-xs);
}

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

.inbox-item.selected {
    background: var(--lavender-light);
    border-color: var(--lavender);
}

.inbox-item.unread {
    background: var(--white);
    border-left: 3px solid var(--coral);
}

.inbox-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--lavender-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--lavender-dark);
    flex-shrink: 0;
}

.inbox-item-content {
    flex: 1;
    min-width: 0;
}

.inbox-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.inbox-item-sender {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-item-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.inbox-item-subject {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: var(--space-xs);
}

.inbox-item-snippet {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-shortcuts-hint {
    padding: var(--space-md);
    background: var(--white);
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

.inbox-shortcuts-hint kbd {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    margin: 0 2px;
}

.email-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
    overflow: hidden;
}

.email-preview-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: var(--space-md);
}

.preview-empty-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.preview-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preview-hint kbd {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin: 0 2px;
}

.email-preview-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.email-preview-subject {
    font-family: 'Nunito', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-md);
}

.email-preview-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-soft);
}

.preview-body {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
}

/* =============================================
   EDIT MODAL
   ============================================= */
.edit-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 450px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.edit-modal h3 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-lg);
}

.edit-modal input[type="text"],
.edit-modal input[type="date"],
.edit-modal select {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-soft);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    transition: var(--transition-normal);
    margin-bottom: var(--space-md);
}

.edit-modal input:focus,
.edit-modal select:focus {
    outline: none;
    border-color: var(--lavender);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--lavender-light);
}

.edit-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.edit-modal-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
}

.edit-modal-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

/* =============================================
   SHORTCUTS MODAL
   ============================================= */
.shortcuts-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.shortcuts-header h2 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.shortcut-item:hover {
    background: var(--lavender-light);
}

.shortcut-desc {
    font-size: 0.85rem;
    color: var(--text);
}

.shortcut-keys {
    display: flex;
    gap: var(--space-xs);
}

.shortcut-keys kbd {
    background: var(--white);
    border: 1px solid var(--border);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-soft);
    min-width: 24px;
    text-align: center;
}

/* =============================================
   NOTES BOTTOM SHEET
   ============================================= */

/* Backdrop overlay */
.notes-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.notes-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Bottom sheet container */
.notes-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 520px;
    height: 85vh;
    max-height: 700px;
    background: var(--white);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    touch-action: none;
}

/* Sheet states */
.notes-sheet[data-state="peek"] {
    transform: translateX(-50%) translateY(calc(100% - 180px));
}

.notes-sheet[data-state="half"] {
    transform: translateX(-50%) translateY(calc(100% - 50vh));
}

.notes-sheet[data-state="full"] {
    transform: translateX(-50%) translateY(0);
}

.notes-sheet.dragging {
    transition: none;
}

/* Drag handle */
.notes-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
    cursor: grab;
    touch-action: none;
}

.notes-sheet-handle:active {
    cursor: grabbing;
}

.notes-handle-bar {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    transition: background 0.2s ease, width 0.2s ease;
}

.notes-sheet-handle:hover .notes-handle-bar {
    background: var(--text-muted);
    width: 44px;
}

/* Header */
.notes-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 16px;
}

.notes-sheet-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notes-sheet-title > span:first-child {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text);
}

.notes-status {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sage);
    padding: 2px 8px;
    background: var(--sage-light);
    border-radius: 10px;
}

.notes-status:empty {
    display: none;
}

/* Action buttons */
.notes-sheet-actions {
    display: flex;
    gap: 4px;
}

.notes-expand-btn,
.notes-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notes-expand-btn:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.notes-close-btn:hover {
    background: var(--coral-light);
    color: var(--coral);
}

/* Body */
.notes-sheet-body {
    flex: 1;
    padding: 0 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notes-textarea {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    background: transparent;
    padding: 0;
}

.notes-textarea:focus {
    outline: none;
}

.notes-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Footer */
.notes-sheet-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
}

.notes-char-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* =============================================
   NEWS OVERLAY
   ============================================= */
.news-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.news-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.news-modal-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.news-modal-actions {
    display: flex;
    gap: var(--space-sm);
}

.news-modal-refresh,
.news-modal-close {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-soft);
    transition: var(--transition-normal);
}

.news-modal-refresh:hover {
    background: var(--lavender-light);
    color: var(--lavender-dark);
}

.news-modal-close:hover {
    background: var(--coral-light);
    color: var(--coral);
}

.news-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    flex: 1;
    overflow: hidden;
}

.news-column {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.news-column-header {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border);
}

.news-column-title {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.news-item {
    display: block;
    padding: var(--space-md);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: var(--transition-normal);
}

.news-item:hover {
    background: var(--white);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.news-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: var(--space-xs);
}

.news-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* =============================================
   TETRIS OVERLAY
   ============================================= */
.tetris-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tetris-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.tetris-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.tetris-close {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-soft);
    transition: var(--transition-normal);
}

.tetris-close:hover {
    background: var(--coral-light);
    color: var(--coral);
}

.tetris-game-container {
    display: flex;
    gap: var(--space-lg);
}

.tetris-canvas {
    background: var(--bg-soft);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
}

.tetris-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    min-width: 120px;
}

.tetris-score-box {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
}

.tetris-score-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.tetris-score-value {
    font-family: 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.tetris-next-box {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
}

.tetris-next-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
}

.tetris-next-canvas {
    background: var(--white);
    border-radius: var(--radius-md);
}

.tetris-start-btn {
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--coral) 0%, var(--peach) 100%);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition-normal);
}

.tetris-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 180, 188, 0.3);
}

.tetris-controls {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.tetris-controls kbd {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin: 0 2px;
}

.tetris-game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(253, 248, 243, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    text-align: center;
}

.tetris-game-over.active {
    display: flex;
}

.tetris-game-over h3 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--coral);
    margin-bottom: var(--space-md);
}

.tetris-game-over p {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: var(--space-lg);
}

/* =============================================
   QUIZ OVERLAY
   ============================================= */
.quiz-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 700px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.quiz-modal-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.quiz-modal-close {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-soft);
    transition: var(--transition-normal);
}

.quiz-modal-close:hover {
    background: var(--coral-light);
    color: var(--coral);
}

.quiz-app-container {
    min-height: 400px;
}

/* =============================================
   WALLPAPER OVERLAY
   ============================================= */
.wallpaper-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.wallpaper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.wallpaper-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.wallpaper-close {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-soft);
    transition: var(--transition-normal);
}

.wallpaper-close:hover {
    background: var(--coral-light);
    color: var(--coral);
}

.wallpaper-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.wallpaper-category {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-soft);
    cursor: pointer;
    transition: var(--transition-normal);
}

.wallpaper-category:hover {
    background: var(--lavender-light);
    border-color: var(--lavender);
}

.wallpaper-category.active {
    background: var(--lavender);
    border-color: var(--lavender);
    color: var(--white);
}

.wallpaper-actions {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.wallpaper-action-btn {
    flex: 1;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-normal);
}

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

.wallpaper-action-btn.secondary:hover {
    background: var(--white);
    border-color: var(--border-strong);
}

.wallpaper-action-btn.primary {
    background: linear-gradient(135deg, var(--coral) 0%, var(--peach) 100%);
    border: none;
    color: var(--white);
}

.wallpaper-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 180, 188, 0.3);
}

.wallpaper-credit {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.wallpaper-credit a {
    color: var(--lavender-dark);
}

/* =============================================
   GEMINI AI PANEL
   ============================================= */
.gemini-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(61, 61, 61, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gemini-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.gemini-panel {
    position: fixed;
    top: 50%;
    right: var(--space-lg);
    transform: translateY(-50%) translateX(calc(100% + var(--space-lg)));
    width: 400px;
    height: 600px;
    max-height: 80vh;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gemini-panel.active {
    transform: translateY(-50%) translateX(0);
}

.gemini-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.gemini-panel-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.gemini-header-actions {
    display: flex;
    gap: var(--space-sm);
}

.gemini-clear-btn,
.gemini-panel-close {
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.gemini-clear-btn:hover {
    background: var(--lavender-light);
    color: var(--lavender-dark);
}

.gemini-panel-close:hover {
    background: var(--coral-light);
    color: var(--coral);
}

.gemini-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.gemini-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
}

.gemini-welcome-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.gemini-welcome-text {
    font-size: 0.9rem;
    line-height: 1.6;
}

.gemini-message {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 90%;
}

.gemini-message.user {
    background: linear-gradient(135deg, var(--lavender) 0%, var(--sky) 100%);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: var(--radius-sm);
}

.gemini-message.assistant {
    background: var(--bg-soft);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: var(--radius-sm);
}

.gemini-message.assistant pre {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    overflow-x: auto;
    margin: var(--space-sm) 0;
}

.gemini-message.assistant code {
    background: var(--lavender-light);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
}

.gemini-message.error {
    background: var(--coral-light);
    color: var(--coral-dark);
    border: 1px solid var(--coral);
}

.gemini-typing {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-md);
    align-self: flex-start;
}

.gemini-typing span {
    width: 8px;
    height: 8px;
    background: var(--lavender);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.gemini-typing span:nth-child(2) { animation-delay: 0.2s; }
.gemini-typing span:nth-child(3) { animation-delay: 0.4s; }

.gemini-input-area {
    padding: var(--space-md);
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.gemini-input-row {
    display: flex;
    gap: var(--space-sm);
}

.gemini-input {
    flex: 1;
    padding: var(--space-md);
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    resize: none;
    transition: var(--transition-normal);
}

.gemini-input:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px var(--lavender-light);
}

.gemini-input::placeholder {
    color: var(--text-muted);
}

.gemini-send-btn {
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--coral) 0%, var(--peach) 100%);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition-normal);
}

.gemini-send-btn:hover {
    transform: scale(1.05);
}

.gemini-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.gemini-api-setup {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
}

.gemini-api-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.gemini-api-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.gemini-api-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.gemini-api-input {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-soft);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    margin-bottom: var(--space-md);
    transition: var(--transition-normal);
}

.gemini-api-input:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px var(--lavender-light);
}

.gemini-api-btn {
    width: 100%;
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--lavender) 0%, var(--sky) 100%);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition-normal);
    margin-bottom: var(--space-md);
}

.gemini-api-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(196, 184, 217, 0.4);
}

.gemini-api-link {
    font-size: 0.8rem;
    color: var(--lavender-dark);
}

.gemini-api-link:hover {
    color: var(--coral);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

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

/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */
@media (max-width: 900px) {
    .superhuman-inbox {
        flex-direction: column;
        height: 90vh;
    }

    .inbox-sidebar {
        width: 100%;
        height: 50%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .email-preview {
        height: 50%;
    }

    .news-columns {
        grid-template-columns: 1fr;
    }

    .gemini-panel,
    .notes-panel {
        width: 95%;
        right: 2.5%;
        max-width: 400px;
    }
}

@media (max-width: 600px) {
    .stats-modal,
    .shortcuts-modal,
    .edit-modal,
    .quiz-modal,
    .wallpaper-modal,
    .news-modal,
    .tetris-modal {
        width: 95%;
        max-width: none;
        border-radius: var(--radius-lg);
        padding: var(--space-md);
    }

    .tetris-game-container {
        flex-direction: column;
    }

    .tetris-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}
