/* CSS Variables for Theming */
:root {
    /* Light theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;

    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --border: #dee2e6;
    --border-light: #e9ecef;
    --shadow: rgba(0, 0, 0, 0.1);

    --habit-color: #10b981;
    --quit-color: #ef4444;

    /* Gradient backgrounds (can be customized per theme) */
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;

    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;

    --primary: #818cf8;
    --primary-hover: #6366f1;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    --border: #374151;
    --border-light: #4b5563;
    --shadow: rgba(0, 0, 0, 0.3);

    --habit-color: #34d399;
    --quit-color: #f87171;

    --gradient-start: #4c1d95;
    --gradient-end: #5b21b6;
}

/* Ocean theme */
[data-theme="ocean"] {
    --bg-primary: #f0f9ff;
    --bg-secondary: #e0f2fe;
    --bg-tertiary: #bae6fd;

    --text-primary: #0c4a6e;
    --text-secondary: #075985;
    --text-muted: #0284c7;

    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --border: #7dd3fc;
    --border-light: #bae6fd;
    --shadow: rgba(14, 165, 233, 0.1);

    --habit-color: #06b6d4;
    --quit-color: #f97316;

    --gradient-start: #0891b2;
    --gradient-end: #0e7490;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    height: 100vh;
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Mobile layout fixes */
@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }
    
    .main-app {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    
    /* Allow scrolling on mobile for full-screen calendar view */
    body.calendar-view-active {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }
}

/* Loading state */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Authentication */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-card h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.subtitle {
    color: #666;
    margin-bottom: 32px;
}

.auth-form h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-label input {
    height: 18px;
    width: 18px;
}

.input-group .input-hint {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #6366f1;
}

.auth-switch {
    margin-top: 24px;
    color: #666;
}

.auth-switch a {
    color: #6366f1;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #5856eb;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #64748b;
}

.btn-secondary:hover {
    background: #475569;
}

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

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
}

/* Main app layout */
.main-app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-header {
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 4px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.header-menu {
    position: relative;
}

.header-menu.header-menu-inline {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.header-menu.header-menu-inline .header-menu-trigger {
    padding: 6px 10px;
}

.header-menu-trigger {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.header-menu-trigger:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.header-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
    margin-top: 4px;
}

.header-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.header-menu-item:hover {
    background: #f9fafb;
}

.header-menu-item:last-child {
    color: #dc2626;
}

.header-menu-item:last-child:hover {
    background: #fef2f2;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.radio-label input {
    width: 16px;
    height: 16px;
}

.radio-label span {
    font-weight: 500;
    color: var(--text-primary);
}

.radio-label:hover {
    border-color: var(--primary);
}

.radio-label input:checked + span {
    color: var(--primary);
}

.header-tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-tabs .activity-tabs {
    margin-bottom: 0;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.1);
    flex: 1;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    overflow-y: auto;
    min-height: 0;
}

/* Today's summary */
.today-summary {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.today-summary h2 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.today-events {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.today-event {
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Activities section */
.activities-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.activities-section h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 0;
}

/* Activity cards */
.activity-card {
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 240px;
    animation: slideInUp 0.25s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

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

/* Staggered animation delays */
.activity-card:nth-child(1) { animation-delay: 0ms; }
.activity-card:nth-child(2) { animation-delay: 50ms; }
.activity-card:nth-child(3) { animation-delay: 100ms; }
.activity-card:nth-child(4) { animation-delay: 150ms; }
.activity-card:nth-child(5) { animation-delay: 200ms; }
.activity-card:nth-child(6) { animation-delay: 250ms; }

/* Drag and Drop Styles */
.activity-card {
    cursor: grab;
}

.activity-card:active {
    cursor: grabbing;
}

.activity-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg) scale(1.05);
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.activity-card.drag-over {
    transform: translateY(-4px);
    border: 2px dashed #6366f1;
}

.activities-grid.dragging {
    gap: 30px;
}

.activity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.activity-info {
    flex: 1;
}

.activity-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.activity-type {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
}

.activity-type.habit {
    background: var(--success);
}

.activity-type.quit {
    background: #f59e0b;
}

.activity-stats {
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.activity-actions {
    display: flex;
    gap: 8px;
}

.log-btn {
    flex: 1;
    font-weight: 600;
    border-radius: 8px;
}

.log-btn.habit {
    background: var(--success);
}

.log-btn.habit:hover {
    background: #059669;
}

.log-btn.quit {
    background: #f59e0b;
}

.log-btn.quit:hover {
    background: #d97706;
}

/* Quit display styles */
.quit-display {
    text-align: center;
    margin: 20px 0;
}

.abstinence-time {
    margin-bottom: 20px;
}

.abstinence-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.time-display {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    min-width: 280px;
    text-align: center;
}

.progress-section {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.progress-circle-container {
    position: relative;
    display: inline-block;
    z-index: 10;
}

.progress-circle {
    position: relative;
    display: inline-block;
    transition: transform 0.2s ease;
}


.progress-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percent {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-goal {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
}

.motivational-text {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 12px;
}

/* Habit display styles */
.habit-display {
    margin: 20px 0;
}

.habit-stats {
    space-y: 8px;
}

.habit-stats .stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.habit-stats .stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.habit-weekly {
    margin-top: 12px;
}

.habit-week-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.habit-week-day {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.habit-week-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow);
}

.habit-week-day:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.habit-week-day.completed {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.habit-week-day.today {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.habit-week-day-label {
    pointer-events: none;
}

.habit-week-day-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    pointer-events: none;
    min-height: 0.7rem;
}

.habit-week-day.completed .habit-week-day-count {
    color: rgba(255, 255, 255, 0.9);
}

/* Goal dropdown styles */
.goal-dropdown {
    position: absolute;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    z-index: 99999;
    min-width: 200px;
    max-width: 280px;
    animation: slideDown 0.2s ease;
    pointer-events: auto;
    display: none;
}

/* Calendar view goal dropdown positioning */
.calendar-goal-dropdown {
    top: calc(100% + 10px);
    right: 0;
}

/* Clickable elements in calendar view */
.clickable-progress,
.clickable-goal {
    cursor: pointer;
}

.clickable-progress:hover {
    transform: scale(1.02);
}

.clickable-goal:hover {
    color: #6366f1;
    text-decoration: underline;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.goal-dropdown-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goal-dropdown-header span {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.close-dropdown {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-dropdown:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.goal-options {
    max-height: 300px;
    overflow-y: auto;
}

.goal-option {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f9fafb;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goal-option:hover {
    background: #f9fafb;
}

.goal-option:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.goal-option.completed {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
}

.goal-option.completed:hover {
    background: #ecfdf5;
}

.goal-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.goal-name {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.goal-progress {
    font-size: 12px;
    color: #6b7280;
}

.goal-option.completed .goal-progress {
    color: #16a34a;
    font-weight: 500;
}

.goal-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.goal-option.disabled .goal-name,
.goal-option.disabled .goal-progress {
    color: #9ca3af;
}

.goal-check {
    color: #22c55e;
    font-weight: 700;
    font-size: 16px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.activity-form {
    padding: 0 24px 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* No activities state */
.no-activities {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-activities p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Messages */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.message {
    background: var(--bg-primary);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    border-left: 4px solid #6366f1;
    animation: slideIn 0.3s ease;
}

.message.success {
    border-left-color: #10b981;
}

.message.error {
    border-left-color: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }
    
    .header-content h1 {
        font-size: 1.3rem;
    }
    
    .header-menu-trigger {
        padding: 6px 10px;
        font-size: 18px;
    }
    
    .header-tabs {
        padding: 2px 16px 0;
        flex-direction: row;
        gap: 4px;
    }
    
    .header-tabs .activity-tabs {
        width: 100%;
    }
    
    .view-toggle {
        align-self: center;
    }
    
    /* Hide all but first view toggle button on mobile */
    .view-toggle .view-toggle-btn:not(:first-child) {
        display: none;
    }
    
    /* Make the single button wider on mobile */
    .view-toggle .view-toggle-btn {
        min-width: 56px;
        padding: 8px 16px;
    }
    
    /* Mobile table styles */
    .activities-table th,
    .activities-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .activities-table th {
        padding: 12px 4px;
    }
    
    .table-activity-name {
        font-size: 13px;
        gap: 4px;
    }
    
    .table-activity-type {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    .table-time {
        font-size: 11px;
    }
    
    .table-action-btn {
        padding: 4px 6px;
        font-size: 14px;
        margin-left: 2px;
    }
    
    /* Stack progress info vertically on mobile */
    .table-progress {
        font-size: 10px;
        line-height: 1.3;
    }

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

    .main-content {
        padding: 12px;
    }

    body.card-density-compact .main-content {
        padding: 10px;
    }
    
    /* Tighter grid spacing on mobile */
    .activities-grid {
        gap: 12px;
    }

    body.card-density-compact .activities-grid {
        gap: 10px;
    }

    .today-summary {
        padding: 16px;
    }
    
    .activities-section {
        padding: 0;
    }

    .activity-card {
        padding: 10px 16px;
        min-height: 165px;
    }

    body.card-density-compact .activity-card {
        padding: 8px 14px;
        min-height: 150px;
    }
    
    /* More compact mobile card elements */
    .activity-header {
        margin-bottom: 0;
    }
    
    .activity-name {
        font-size: 1.05rem;
        margin-bottom: 2px;
    }
    
    .activity-type {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    /* Compact quit display for mobile */
    .quit-display-modern {
        padding: 12px 0;
    }
    
    .quit-content {
        gap: 12px;
    }
    
    .time-display-large {
        font-size: 20px;
        margin-bottom: 8px;
        line-height: 1.1;
    }
    
    .abstinence-label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .slipped-up-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* Progress circles on mobile */
    .progress-circle svg {
        width: 120px;
        height: 120px;
    }
    
    .progress-content {
        font-size: 0.85rem;
    }
    
    .progress-percent {
        font-size: 0.9rem;
    }
    
    .progress-goal {
        font-size: 0.7rem;
    }
    
    /* Compact habit display */
    .habit-display {
        margin: 12px 0;
    }
    
    .habit-stats .stat-item {
        margin-bottom: 6px;
        font-size: 13px;
    }
    
    .habit-actions {
        padding: 12px 0 0;
        margin-top: 12px;
    }

    body.card-density-compact .habit-actions {
        padding-top: 10px;
        margin-top: 10px;
    }
    
    .habit-actions .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .fullscreen-calendar-view {
        margin: 0;
        padding: 10px;
    }
    
    /* Reduce all other 20px padding to 10px on mobile */
    .calendar-view {
        padding: 10px;
    }
    
    .fullscreen-calendar-view {
        padding: 10px;
    }
    
    .quit-display-modern {
        padding: 10px 0;
    }
    
    .habit-display {
        margin: 10px 0;
    }

    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    .message-container {
        left: 10px;
        right: 10px;
    }
}

/* Calendar View Styles */
.calendar-view {
    padding: 20px;
}

/* Full-screen Calendar View */
.fullscreen-calendar-view {
    padding: 20px;
    min-height: 500px;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 0;
    animation: fadeInScale 0.25s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

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

.fullscreen-calendar-view .calendar-header {
    margin-bottom: 5px;
}

.fullscreen-calendar-view .calendar-header h2 {
    color: #374151;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.fullscreen-calendar-view .progress-section {
    margin-top: 5px;
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.fullscreen-calendar-view .calendar-container {
    max-width: 800px;
    margin: 0 auto;
}

.calendar-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    gap: 12px;
}

.calendar-header h3 {
    color: #374151;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.progress-section {
    text-align: center;
    margin-top: 5px;
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.abstinence-time {
    margin-top: 16px;
    flex: 1;
    max-width: 300px;
}

.abstinence-label {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.time-display {
    font-size: 24px;
    font-weight: 700;
    color: #374151;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    min-width: 100%;
    display: block;
}

.calendar-container {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 8px;
}

.calendar-nav button {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    color: #374151;
}

.calendar-nav button:hover {
    background: #f3f4f6;
}

#current-month {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

.calendar-grid {
    width: 100%;
}

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

.calendar-day-header {
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day {
    position: relative;
    background: var(--bg-primary);
    min-height: 44px;
    padding: 6px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.calendar-day.empty {
    background: #f9fafb;
}

.calendar-day.today {
    background: #eff6ff;
}

.calendar-day.has-event {
    background: #fef3f2;
}

.calendar-day.today.has-event {
    background: #e0f2fe;
}

.day-number {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    line-height: 1;
}

.calendar-day.today .day-number {
    color: #1d4ed8;
    font-weight: 600;
}

.event-marker {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--danger);
    border-radius: 50%;
}

.calendar-day.today .event-marker {
    background: #1d4ed8;
}

.calendar-day.clickable-day {
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day.clickable-day:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: scale(1.02);
}

.calendar-day.clickable-day.today:hover {
    background: #dbeafe;
}

.calendar-day.clickable-day.has-event:hover {
    background: #fde8e8;
}

/* Activity Tabs Styles */
.activity-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: #f9fafb;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tab-button:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.tab-button.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-icon {
    font-size: 16px;
}

.tab-count {
    background: #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.tab-button.active .tab-count {
    background: #dbeafe;
    color: #1d4ed8;
}

.tab-content {
    position: relative;
    overflow: hidden;
}

.tab-pane {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

.tab-pane.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
    pointer-events: auto;
}

/* Modern Quit Card Styles */
.quit-display-modern {
    padding: 0 0 10px 0;
}

.quit-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.quit-left {
    flex: 1;
}

.quit-right {
    flex-shrink: 0;
}

.abstinence-label {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: 500;
}

.time-display-large {
    font-size: 24px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.slipped-up-container {
    margin-top: 12px;
}

.slipped-up-btn {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slipped-up-btn:hover {
    background: #fecaca;
    border-color: #f87171;
}

/* Activity Menu Styles */
.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.activity-menu {
    position: relative;
}

.menu-trigger {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.menu-trigger:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    min-width: 120px;
    z-index: 1000;
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.menu-item:hover {
    background: #f9fafb;
}

.menu-item:last-child {
    color: #dc2626;
}

.menu-item:last-child:hover {
    background: #fef2f2;
}

/* Clickable card styles */
.activity-card.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Hide habit actions for quit cards */
.habit-actions {
    padding: 16px 0 0;
    border-top: 1px solid #f3f4f6;
    margin-top: 16px;
}

body.title-hidden .header-content {
    display: none;
}

body.title-hidden .app-header {
    padding: 6px 0;
}

body.title-hidden .header-tabs {
    padding-top: 2px;
    align-items: center;
}

body.title-hidden .view-toggle {
    background: transparent;
    border: none;
    padding: 0;
    gap: 6px;
    justify-content: flex-end;
}

body.title-hidden .view-toggle-btn {
    min-width: 40px;
}

body.title-hidden .header-menu.header-menu-inline {
    margin-left: 4px;
}

body.title-hidden .header-menu.header-menu-inline .header-dropdown {
    top: calc(100% + 6px);
    right: 0;
}

body.card-density-compact .activities-grid {
    gap: 18px;
}

body.card-density-compact .activity-card {
    min-height: 200px;
    padding: 12px 18px;
}

body.card-density-compact .main-content {
    padding: 16px;
}

body.card-density-compact .habit-display {
    margin: 12px 0;
}

body.card-density-compact .habit-stats .stat-item {
    margin-bottom: 6px;
}

body.card-density-compact .habit-week-days {
    gap: 6px;
}

body.card-density-compact .quit-display-modern {
    padding: 16px;
}

body.card-density-compact .habit-actions {
    padding-top: 12px;
    margin-top: 12px;
}

/* View Toggle Styles */
.view-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.view-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 36px;
}

.view-toggle-btn:hover {
    background: var(--bg-primary);
    color: #1f2937;
    transform: scale(1.05);
}

.view-toggle-btn.active {
    background: var(--bg-primary);
    color: #1f2937;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Activities Table Styles */
.activities-table {
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.activities-table table {
    width: 100%;
    border-collapse: collapse;
}

.activities-table th {
    background: rgba(0, 0, 0, 0.05);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.activities-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.activities-table tr:last-child td {
    border-bottom: none;
}

.activities-table tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.table-activity-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.table-activity-type {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
}

.table-activity-type.habit {
    background: #dcfce7;
    color: #166534;
}

.table-activity-type.quit {
    background: #fef2f2;
    color: #dc2626;
}

.table-progress {
    text-align: center;
}

.table-time {
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-weight: 600;
    color: #374151;
}

.table-actions {
    text-align: right;
}

.table-action-btn {
    background: transparent;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: #6b7280;
    margin-left: 4px;
    transition: all 0.2s ease;
}

.table-action-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Logs Tab Styles */
.logs-content {
    padding: 20px 0;
}

.logs-content h3 {
    color: #374151;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* PWA specific styles */
@media (display-mode: standalone) {
    .app-header {
        padding-top: max(16px, env(safe-area-inset-top));
    }
}

/* Event tally system */
.event-tally {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
}

.tally-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.tally-dot.red {
  background: #dc3545;
}

.tally-dot.orange {
  background: #fd7e14;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  font-weight: bold;
}

/* Day entries modal */
.modal-content.day-entries-modal {
  background: var(--bg-primary);
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 70vh;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.day-entries-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}

.day-entries-list {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 100px;
  max-height: calc(70vh - 180px); /* Account for header and footer */
}

.day-entry-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border-radius: 4px;
}

.day-entry-time {
  font-weight: 500;
  color: #495057;
}

.day-entry-note {
  color: #6c757d;
  font-size: 14px;
  margin-top: 4px;
}

.day-entry-delete {
  background: #dc3545;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.day-entry-delete:hover {
  background: #c82333;
}

.day-entries-footer {
  padding: 20px;
  border-top: 1px solid #e9ecef;
  text-align: center;
  flex-shrink: 0;
  background: var(--bg-primary);
}

.add-new-entry-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
}

.add-new-entry-btn:hover {
  opacity: 0.9;
}

.add-new-entry-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.no-entries-message {
  text-align: center;
  color: #6c757d;
  padding: 40px 20px;
}

/* Settings Modal */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.settings-modal-content {
  background: var(--bg-primary);
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  height: 85vh;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 30px;
  border-bottom: 2px solid #e9ecef;
  background: #f8f9fa;
}

.settings-header h2 {
  margin: 0;
  color: #2c3e50;
  font-size: 24px;
}

.settings-close-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.settings-close-btn:hover {
  background: #e9ecef;
  color: #2c3e50;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.settings-section {
  margin-bottom: 40px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h3 {
  margin: 0 0 20px 0;
  color: #495057;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 10px;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid #f1f3f5;
}

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

.settings-item label {
  font-weight: 500;
  color: #495057;
  font-size: 15px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-weight: normal;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

.checkbox-label span {
  font-weight: normal;
  color: #495057;
}

.settings-value {
  color: #6c757d;
  font-size: 15px;
}

.settings-select {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: var(--bg-primary);
  color: #495057;
  font-size: 14px;
  min-width: 200px;
  cursor: pointer;
}

.settings-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.settings-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.settings-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 14px;
}

.settings-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

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

.btn-danger:hover {
  background: #c82333;
}

/* Mobile responsiveness for settings */
@media (max-width: 768px) {
  .settings-modal-content {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .settings-body {
    padding: 20px;
  }

  .settings-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .settings-select {
    width: 100%;
  }
}

/* Theme Creator Styles */
.theme-creator-content {
    background: var(--bg-primary);
}

.theme-creator-form {
    padding: 20px;
}

.color-section {
    margin-bottom: 30px;
}

.color-section h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.color-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-input-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.color-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 50px;
    height: 35px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
}

.color-text-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.875rem;
}

.theme-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group {
    margin-bottom: 20px;
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: var(--bg-secondary);
}

/* API Key styles */
#api-key-modal {
  z-index: 3000 !important;
}

#api-docs-modal {
  z-index: 3000 !important;
}

.api-keys-list {
  margin-top: 20px;
  max-height: 200px;
  overflow-y: auto;
}

.api-key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 4px;
  margin-bottom: 8px;
}

.api-key-info {
  flex: 1;
}

.api-key-name {
  font-weight: 500;
  color: #2c3e50;
}

.api-key-date {
  font-size: 12px;
  color: #6c757d;
  margin-top: 4px;
}

.api-key-display {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 4px;
}

.api-key-display code {
  flex: 1;
  font-family: monospace;
  font-size: 14px;
  word-break: break-all;
  background: var(--bg-primary);
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.warning-message {
  background: #fff3cd;
  color: #856404;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #ffeaa7;
  margin-bottom: 15px;
}

/* API Documentation styles */
.api-docs-content {
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
}

.api-docs-body {
  padding: 30px;
  overflow-y: auto;
  max-height: calc(85vh - 80px);
}

.api-docs-body h4 {
  margin-top: 30px;
  margin-bottom: 15px;
  color: #2c3e50;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 10px;
}

.api-docs-body h4:first-child {
  margin-top: 0;
}

.api-endpoint {
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #6366f1;
}

.api-endpoint h5 {
  margin: 0 0 10px 0;
  color: #495057;
}

.api-endpoint code {
  background: var(--bg-primary);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  display: inline-block;
  margin: 5px 0;
}

.api-endpoint pre {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 10px 0;
}

.api-endpoint pre code {
  background: transparent;
  color: #ecf0f1;
  padding: 0;
}

.api-docs-body > pre {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 15px 0;
}

.api-docs-body > pre code {
  background: transparent;
  color: #ecf0f1;
  font-size: 13px;
}

/* Custom abstinence text input styles */
.label-hint {
  font-size: 12px;
  color: #6c757d;
  font-weight: normal;
  display: block;
  margin-top: 2px;
}

.input-with-edit {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-edit input {
  flex: 1;
}

.edit-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: opacity 0.2s;
}

.edit-btn:hover {
  opacity: 0.8;
}

.edit-btn.active {
  background: #4ade80;
}
