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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    color: #2c3e50;
    line-height: 1.5;
}

/* ========================================
   HEADER
   ======================================== */

.header {
    background: #2c3e50;
    color: white;
    padding: 12px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-decoration: none;
    color: white;
}

.logo:hover {
    color: white;
}

.logo-scattered {
    opacity: 0.6;
}

.logo-structured {
    opacity: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

/* ========================================
   MAIN LAYOUT - TWO COLUMNS
   ======================================== */

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

/* ========================================
   LEFT SIDEBAR (1/3)
   ======================================== */

.sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

/* Quick Capture */
.quick-capture {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8ecef;
}

.capture-label {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.capture-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #e8ecef;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

.capture-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.btn-post {
    width: 100%;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

/* Navigation Sections */
.nav-section {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8ecef;
}

.nav-title {
    color: #2c3e50;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

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

.nav-item {
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    text-decoration: none;
    color: #2c3e50;
}

.nav-item:hover {
    background: #f8f9fa;
}

.nav-item.active {
    background: #3498db;
    color: white;
}

.nav-item-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-item .nav-dot.user {
    background: #3498db;
}

.nav-item .nav-dot.project {
    background: #e67e22;
}

.nav-item.active .nav-dot {
    background: white;
}

.nav-count {
    color: #95a5a6;
    font-size: 12px;
    font-weight: 500;
}

.nav-item.active .nav-count {
    color: rgba(255,255,255,0.8);
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.btn-logout {
    width: 100%;
    padding: 0.75rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 0.5rem;
}

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

.btn-accmgmt {
    width: 100%;
    padding: 0.55rem;
    background: #9256dc;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.btn-accmgmt:hover {
    background: #833fd7;
}

/* ========================================
   RIGHT CONTENT AREA (2/3)
   ======================================== */

.content-area {
    min-height: 100vh;
}

/* Filter Bar */
.filter-bar {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8ecef;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    color: #95a5a6;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e8ecef;
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2c3e50;
}

.filter-btn:hover {
    border-color: #2c3e50;
}

.filter-btn.active {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

/* ========================================
   THOUGHT CARDS
   ======================================== */

.thought-card {
    background: white;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    border: 1px solid #e8ecef;
}

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

.thought-card.is-task {
    border-left: 3px solid #27ae60;
}

/* Card Main Content */
.card-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #27ae60;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 11px;
    color: white;
}

.task-checkbox:hover {
    background: #ecf9f2;
}

.task-checkbox.checked {
    background: #27ae60;
}

.thought-content {
    flex: 1;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.5;
}

.thought-content.completed {
    text-decoration: line-through;
    color: #95a5a6;
}

/* Card Footer - Tags Left, Actions Right */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f0f3f5;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.tags-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Tag Styles */
.tag {
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.tag:hover {
    opacity: 0.7;
}

.tag.user {
    color: #3498db;
}

.tag.ai {
    color: #9b59b6;
}

.tag.project {
    color: #e67e22;
}

.tag.person {
    color: #16a085;
}

/* Timestamp & Due Date */
.timestamp {
    color: #95a5a6;
    font-size: 12px;
    white-space: nowrap;
}

.due-date {
    color: #f39c12;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.due-date.overdue {
    color: #e74c3c;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.action-btn {
    color: #95a5a6;
    font-size: 12px;
    cursor: pointer;
    border: none;
    background: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    height: 24px;
    line-height: 1;
}

.action-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

/* Fix for button submit elements in card actions */
.card-actions form {
    display: inline;
    margin: 0;
}

.card-actions input[type="submit"],
.card-actions button[type="submit"] {
    color: #95a5a6;
    font-size: 12px;
    cursor: pointer;
    border: none;
    background: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.card-actions input[type="submit"]:hover,
.card-actions button[type="submit"]:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

/* AI Processing Badge */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.ai-badge.pending {
    background: #fef5e7;
    color: #f39c12;
}

.ai-badge.processed {
    background: #eafaf1;
    color: #27ae60;
}

.ai-badge.failed {
    background: #fadbd8;
    color: #e74c3c;
}

/* ========================================
   FORMS (Base Styles)
   ======================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control,
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

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

.form-input::placeholder {
    color: #9ca3af;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.help-text {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

/* Form Actions */
.form-actions {
    margin-top: 1.5rem;
}

/* ========================================
   BUTTONS (Base Styles)
   ======================================== */

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    padding: 0.5rem 1rem;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

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

.btn-outline {
    background: transparent;
    border: 2px solid #2c3e50;
    color: #2c3e50;
}

.btn-outline:hover {
    background: #2c3e50;
    color: white;
}

/* ========================================
   ALERTS & NOTICES
   ======================================== */

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #eafaf1;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.alert-danger {
    background: #fadbd8;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.alert-warning {
    background: #fef5e7;
    color: #f39c12;
    border: 1px solid #f39c12;
}

.alert-info {
    background: #ebf5fb;
    color: #3498db;
    border: 1px solid #3498db;
}

/* Error Messages */
#error_explanation {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

#error_explanation h2 {
    color: #dc2626;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-align: left;
}

#error_explanation ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #991b1b;
    font-size: 0.875rem;
}

/* ========================================
   AUTH PAGES (Login, Sign Up, Edit Account)
   ======================================== */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    color: #1f2937;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1.875rem;
    font-weight: 700;
}

.auth-subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

/* Auth Links (Sign up / Forgot password / etc.) */
.auth-links {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.auth-links a {
    color: #6366f1;
    text-decoration: none;
    font-size: 0.875rem;
}

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

/* Danger Zone (for account deletion) */
.danger-zone {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #fee2e2;
}

.danger-zone h3 {
    color: #dc2626;
    margin-bottom: 0.5rem;
}

.danger-zone p {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ========================================
   ACCOUNT MANAGEMENT PAGE
   ======================================== */

.account-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.account-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.account-card h2 {
    color: #6366f1;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

/* Account Footer (used for danger zone in full account settings page) */
.account-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #fee2e2;
}

.account-footer h3 {
    color: #dc2626;
    margin-bottom: 0.5rem;
}

.account-footer p {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Account Actions */
.account-actions {
    margin-top: 2rem;
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    color: #6366f1;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* ========================================
   PROJECT PAGES
   ======================================== */

.project-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.project-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.project-header h1 {
    color: #6366f1;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.project-meta {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Bullet list styling for project thoughts */
.project-thoughts-list ul {
    list-style: none;
    padding: 0;
}

.project-thought-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    padding-left: 1.5rem;
}

/* Add bullet point */
.project-thought-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6366f1;
    font-size: 1.5rem;
    line-height: 1.5rem;
}

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

.thought-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 3rem;
    font-style: italic;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-muted {
    color: #95a5a6;
}

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

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .nav-section {
        display: none;
    }
}

@media (max-width: 600px) {
    .header-content {
        padding: 0 12px;
    }
    
    .main-container {
        padding: 12px;
        gap: 16px;
    }
    
    .user-name {
        display: none;
    }
    
    .filter-bar {
        padding: 12px;
    }
    
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .card-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .quick-capture {
        padding: 12px;
    }
    
    .thought-card {
        padding: 12px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .header,
    .sidebar,
    .filter-bar,
    .card-actions {
        display: none;
    }
    
    .main-container {
        grid-template-columns: 1fr;
        padding: 0;
    }
    
    .thought-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
