﻿/* AXIOM Design System */
:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #141417;
    --bg-tertiary: #1c1c21;
    --text-primary: #f5f5f7;
    --text-secondary: #8e8e93;
    --text-muted: #636366;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --success: #22c55e;
    --border: #2c2c31;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* App Container */
.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

/* God Bar Section */
.god-bar-section {
    padding: 48px 0 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.god-bar-container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.god-bar {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-size: 17px;
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: all 0.2s;
}

.god-bar:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.god-bar::placeholder {
    color: var(--text-muted);
}

/* Input actions row */
.input-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* Force action buttons - mobile friendly */
.force-actions {
    display: flex;
    gap: 8px;
}

.force-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 12px 16px;
    font-size: 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px; /* Touch-friendly minimum */
}

.force-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
    color: var(--text-primary);
}

.force-btn:active {
    transform: scale(0.98);
}

.force-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.force-btn .btn-label {
    white-space: nowrap;
}

.voice-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 12px 16px;
    font-size: 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.voice-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
    color: var(--text-primary);
}

.voice-btn.recording {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.voice-label {
    font-weight: 500;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ef4444;
    font-size: 14px;
}

.recording-indicator.hidden {
    display: none;
}

.recording-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.submit-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

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

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

/* Input hints - keyboard shortcuts */
.input-hints {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.input-hints .hint-desktop {
    display: inline;
}

/* Response Area */
.response-area {
    max-width: 700px;
    margin: 0 auto 32px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
}

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

.response-area.hidden {
    display: none;
}

.response-summary {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-primary);
}

.response-detail {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

.response-detail.hidden {
    display: none;
}

.detail-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}

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

.capture-success {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--success);
    font-size: 17px;
}

.capture-success .checkmark {
    font-size: 24px;
}

.capture-entities {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.entity-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
}

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

.stats-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.stats-card h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.stat-number {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.dashboard-right h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.recent-list {
    list-style: none;
}

.recent-list li {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.recent-list li:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.recent-list .thought-content {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.recent-list .thought-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.recent-list .loading {
    color: var(--text-muted);
    font-style: italic;
}

/* Thoughts View */
.stats-card.clickable { cursor: pointer; transition: all 0.2s; }
.stats-card.clickable:hover { border-color: var(--accent); transform: translateY(-2px); }
.thoughts-header { display: flex; align-items: center; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.thoughts-header h2 { font-size: 20px; font-weight: 600; }
.back-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); padding: 8px 16px; font-size: 14px; border-radius: var(--radius-sm); cursor: pointer; min-height: 44px; }
.back-btn:hover { background: var(--bg-tertiary); border-color: var(--accent); }
.thoughts-search { flex: 1; max-width: 400px; min-width: 200px; }
.search-input { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 16px; font-size: 15px; color: var(--text-primary); outline: none; min-height: 44px; }
.search-input:focus { border-color: var(--accent); }
.thoughts-list-container { padding: 24px 0; max-height: calc(100vh - 200px); overflow-y: auto; }
.thoughts-list { list-style: none; }
.thought-item { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.thought-content-wrapper { margin-bottom: 12px; }
.thought-text { font-size: 15px; line-height: 1.6; cursor: pointer; padding: 8px; border-radius: var(--radius-sm); }
.thought-text:hover { background: var(--bg-tertiary); }
.thought-edit { width: 100%; min-height: 80px; background: var(--bg-primary); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 12px; font-size: 15px; color: var(--text-primary); resize: vertical; outline: none; font-family: inherit; }
.thought-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.thought-meta { font-size: 13px; color: var(--text-muted); }
.thought-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.thought-actions button { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); cursor: pointer; min-height: 36px; }
.thought-actions button:hover { background: var(--bg-tertiary); }
.btn-save { border-color: var(--success) !important; color: var(--success) !important; }
.btn-delete { border-color: #ef4444 !important; color: #ef4444 !important; }
.btn-danger { background: #ef4444 !important; border: none !important; color: white !important; padding: 10px 24px; border-radius: var(--radius-sm); cursor: pointer; min-height: 44px; }
.btn-secondary { background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-secondary); padding: 10px 20px; border-radius: var(--radius-sm); cursor: pointer; min-height: 44px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal.hidden { display: none; }
.modal-content { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 400px; width: 100%; text-align: center; }
.modal-content h3 { margin-bottom: 8px; }
.modal-content p { color: var(--text-secondary); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hidden { display: none !important; }

.btn-primary {
    background: var(--accent);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    min-height: 44px;
}
.btn-primary:hover {
    opacity: 0.9;
}

/* Recent items inline editing */
.recent-item {
    position: relative;
}
.recent-item .thought-edit {
    width: 100%;
    min-height: 60px;
    background: var(--bg-primary);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 8px;
    font-size: 14px;
    color: var(--text-primary);
    resize: vertical;
    font-family: inherit;
}
.recent-item .recent-text {
    cursor: pointer;
}
.recent-item .recent-text:hover {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}
.recent-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 8px;
}
.recent-item .thought-actions {
    display: flex;
    gap: 6px;
}
.recent-item .thought-actions button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    min-height: 32px;
}
.recent-item .thought-actions button:hover {
    background: var(--bg-tertiary);
}
.recent-item .btn-save {
    border-color: var(--success) !important;
    color: var(--success) !important;
}
.recent-item .btn-delete {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

/* Drag and drop */
.god-bar-section.drag-over {
    background: rgba(99, 102, 241, 0.1);
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
}

/* ============ MOBILE RESPONSIVE ============ */

@media (max-width: 768px) {
    .app {
        padding: 0 16px;
    }

    .header {
        padding: 16px 0;
    }

    .god-bar-section {
        padding: 24px 0 20px;
    }

    .god-bar {
        font-size: 16px;
        padding: 14px 16px;
    }

    .input-actions {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 600px;
    }

    .force-actions {
        width: 100%;
        justify-content: center;
    }

    .force-btn {
        flex: 1;
        justify-content: center;
    }

    .voice-input {
        width: 100%;
        justify-content: center;
    }

    .voice-btn {
        flex: 1;
        justify-content: center;
    }

    .submit-btn {
        width: 100%;
        max-width: 600px;
    }

    /* Hide keyboard hints on mobile */
    .input-hints .hint-desktop {
        display: none;
    }

    .dashboard {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .dashboard-left {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .stats-card {
        margin-bottom: 0;
        padding: 16px;
    }

    .stat-number {
        font-size: 24px;
    }

    .thoughts-header {
        padding: 16px 0;
        gap: 12px;
    }

    .thoughts-header h2 {
        font-size: 18px;
        width: 100%;
        order: -1;
    }

    .thoughts-search {
        flex: 1;
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .app {
        padding: 0 12px;
    }

    .dashboard-left {
        grid-template-columns: 1fr;
    }

    .stats-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .stats-card h3 {
        margin-bottom: 0;
    }

    .stat {
        margin-bottom: 0;
    }

    .force-actions {
        flex-direction: column;
    }

    .force-btn {
        width: 100%;
    }

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

    .modal-actions button {
        width: 100%;
    }
}

/* Upcoming reminders */
.upcoming-item {
    cursor: default;
}
.upcoming-item:hover {
    transform: none;
}
.upcoming-date {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.date-badge {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.days-until {
    color: var(--text-secondary);
    font-size: 13px;
}
.days-until:before {
    content: " ";
}
