/* ============================================================================
   Concussion Companion - Dark Theme Stylesheet
   PCS-optimized: calm, no animations, high contrast, large targets
   ============================================================================ */

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #0a0a0a;
    color: #e8e8e8;
    line-height: 1.5;
}

/* ============================================================================
   Auth Pages (Landing & Onboarding)
   ============================================================================ */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #0a0a0a;
    padding: 20px;
}

.auth-card {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
}

.auth-card h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #e8e8e8;
}

.auth-card .subtitle {
    color: #999;
    margin-bottom: 30px;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #ccc;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    background-color: #0a0a0a;
    color: #e8e8e8;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input::placeholder {
    color: #666;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a9eff;
}

.btn {
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-bottom: 8px;
    transition: none;
}

.btn-primary {
    background-color: #4a9eff;
    color: #0a0a0a;
}

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

.btn-secondary {
    background-color: #333;
    color: #e8e8e8;
    border: 1px solid #555;
}

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

.error-message {
    background-color: #4a0a0a;
    color: #ff6b6b;
    padding: 12px;
    border-radius: 4px;
    margin-top: 12px;
    font-size: 13px;
}

/* ============================================================================
   Chat App Layout
   ============================================================================ */

.app-layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: #1a1a1a;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 16px;
    color: #e8e8e8;
}

.btn-close {
    display: none;
    background: none;
    border: none;
    color: #e8e8e8;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
}

.sidebar-module {
    border-bottom: 1px solid #333;
}

.module-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #999;
    user-select: none;
}

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

.badge {
    background-color: #4a9eff;
    color: #0a0a0a;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.module-body {
    padding: 12px;
    background-color: #0a0a0a;
}

.task-item,
.recurring-item,
.file-item {
    padding: 8px;
    margin-bottom: 6px;
    background-color: #1a1a1a;
    border-radius: 4px;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.task-item input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
    min-width: 16px;
}

.task-item span,
.file-item span {
    flex: 1;
    word-break: break-word;
}

.recurring-item strong {
    display: block;
    color: #e8e8e8;
}

.recurring-item small {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 2px;
}

.empty-state {
    color: #666;
    font-size: 12px;
    text-align: center;
    padding: 8px;
}

.sidebar-footer {
    padding: 16px;
    margin-top: auto;
    border-top: 1px solid #333;
}

.sidebar-footer .btn {
    margin-bottom: 0;
}

/* ============================================================================
   Chat Container
   ============================================================================ */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #0a0a0a;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-menu {
    display: none;
    background: none;
    border: none;
    color: #e8e8e8;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.chat-header h1 {
    font-size: 18px;
    flex: 1;
    color: #e8e8e8;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.message.user {
    justify-content: flex-end;
}

.message p {
    max-width: 70%;
    padding: 12px 14px;
    border-radius: 6px;
    line-height: 1.4;
    font-size: 14px;
}

.message.assistant p {
    background-color: #1a1a1a;
    color: #e8e8e8;
    border-left: 2px solid #4a9eff;
}

.message.user p {
    background-color: #4a9eff;
    color: #0a0a0a;
}

.message.error p {
    background-color: #4a0a0a;
    color: #ff6b6b;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid #333;
    background-color: #0a0a0a;
}

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

.input-controls textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    background-color: #1a1a1a;
    color: #e8e8e8;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 100px;
}

.input-controls textarea:focus {
    outline: none;
    border-color: #4a9eff;
}

.input-controls textarea::placeholder {
    color: #666;
}

.input-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-voice {
    background: none;
    border: 1px solid #333;
    color: #e8e8e8;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

.btn-voice:hover {
    background-color: #222;
}

.input-buttons .btn {
    flex: 1;
    margin-bottom: 0;
    min-height: 44px;
}

/* ============================================================================
   Toast Notifications
   ============================================================================ */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    z-index: 1000;
}

.toast {
    background-color: #1a3a2a;
    color: #7fff9f;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 13px;
    border-left: 3px solid #4a9e6f;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.toast.error {
    background-color: #4a0a0a;
    color: #ff6b6b;
    border-left-color: #ff3333;
}

.toast.info {
    background-color: #0a2a4a;
    color: #7fb3ff;
    border-left-color: #4a9eff;
}

.toast.fade-out {
    opacity: 0;
}

/* ============================================================================
   Responsive Design (Mobile)
   ============================================================================ */

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%);
        transition: none;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .btn-menu {
        display: block;
    }

    .btn-close {
        display: block;
    }

    .message p {
        max-width: 85%;
    }

    .auth-card {
        padding: 30px 20px;
    }
}

/* ============================================================================
   Accessibility & PCS Optimizations
   ============================================================================ */

/* Large click targets (minimum 44x44px) */
button,
input[type="checkbox"],
input[type="radio"],
select {
    min-height: 44px;
    min-width: 44px;
}

/* Remove animations for PCS users */
* {
    transition: none;
}

/* High contrast for readability */
a {
    color: #4a9eff;
    text-decoration: underline;
}

a:hover {
    color: #5aadff;
}

/* Scrollbar styling (dark theme) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Focus states for keyboard navigation */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
