/* ═══════════════════════════════════════════════════════════════════════════
   HABIT LOOPS PAGE STYLES
   DSP-07 Extension - Habit Loop Generator
   ═══════════════════════════════════════════════════════════════════════════ */

/* Enable scrolling for this page */
body.habit-loops-page {
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
}

body.habit-loops-page #app {
    height: auto;
    min-height: 100vh;
}

/* Page Layout */
.habit-loops-page {
    background: linear-gradient(135deg, #0a0a12 0%, #0d0d18 50%, #0a0a12 100%);
    min-height: 100vh;
}

.habits-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    padding-top: calc(60px + 1rem);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.habits-header {
    text-align: center;
    padding: 2rem 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0 0 0.5rem 0;
}

.page-subtitle {
    font-family: 'Crimson Pro', serif;
    font-size: 1rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════════════════════════════════ */

.stats-section {
    padding: 0 0 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #64b4a0;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════════════════════════════════ */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.title-icon {
    font-size: 1.2rem;
}

.add-habit-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #64b4a0, #508cb4);
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-habit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(100, 180, 160, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HABITS LIST
   ═══════════════════════════════════════════════════════════════════════════ */

.active-habits-section {
    padding: 1.5rem 0;
}

.habits-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.habit-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.habit-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.habit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.habit-strength {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.strength-bar {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    background: linear-gradient(90deg, #64b4a0, #508cb4);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.strength-text {
    font-size: 0.75rem;
    color: #64b4a0;
    font-weight: 500;
}

.habit-streak {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.habit-loop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.loop-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.loop-step.cue {
    border-left: 3px solid #c87864;
}

.loop-step.ritual {
    border-left: 3px solid #64b4a0;
}

.loop-step.reward {
    border-left: 3px solid #6b9bc3;
}

.step-icon {
    font-size: 0.9rem;
}

.step-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.loop-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.habit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.habit-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.habit-btn:hover {
    background: rgba(100, 180, 160, 0.15);
    border-color: rgba(100, 180, 160, 0.3);
}

.habit-btn.complete {
    background: linear-gradient(135deg, rgba(100, 180, 160, 0.2), rgba(80, 140, 180, 0.15));
    border-color: rgba(100, 180, 160, 0.3);
    color: #64b4a0;
}

.habit-btn.reinforce {
    background: rgba(180, 160, 100, 0.1);
    border-color: rgba(180, 160, 100, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SUGGESTIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.suggestions-section {
    padding: 1.5rem 0;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.suggestion-card {
    background: linear-gradient(135deg, rgba(100, 140, 180, 0.08) 0%, rgba(100, 180, 160, 0.05) 100%);
    border: 1px solid rgba(100, 140, 180, 0.2);
    border-radius: 14px;
    padding: 1rem;
}

.suggestion-loop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.suggestion-reason {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.adopt-btn {
    width: 100%;
    padding: 0.6rem;
    background: rgba(100, 180, 160, 0.15);
    border: 1px solid rgba(100, 180, 160, 0.3);
    border-radius: 10px;
    color: #64b4a0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.adopt-btn:hover {
    background: rgba(100, 180, 160, 0.25);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MONTHLY ARC
   ═══════════════════════════════════════════════════════════════════════════ */

.arc-section {
    padding: 1.5rem 0 2rem;
}

.arc-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
}

.arc-empty {
    text-align: center;
    padding: 1rem;
}

.arc-empty p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.start-arc-btn {
    background: linear-gradient(135deg, rgba(180, 100, 180, 0.2), rgba(100, 140, 180, 0.15));
    border: 1px solid rgba(180, 100, 180, 0.3);
    border-radius: 20px;
    padding: 0.6rem 1.5rem;
    color: #b480b4;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.start-arc-btn:hover {
    background: linear-gradient(135deg, rgba(180, 100, 180, 0.3), rgba(100, 140, 180, 0.25));
}

.arc-active {
    text-align: left;
}

.arc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.arc-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: #e8e8e8;
}

.arc-progress-badge {
    background: rgba(180, 100, 180, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #b480b4;
}

.arc-focus {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.arc-weeks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.arc-week {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.arc-week:hover {
    background: rgba(255, 255, 255, 0.08);
}

.arc-week.completed {
    background: rgba(100, 180, 160, 0.15);
    border-color: rgba(100, 180, 160, 0.3);
}

.arc-week.current {
    border-color: rgba(180, 100, 180, 0.5);
    box-shadow: 0 0 10px rgba(180, 100, 180, 0.2);
}

.week-num {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.week-theme {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.week-check {
    color: #64b4a0;
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

.habit-modal,
.arc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 8, 13, 0.9);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.habit-modal.hidden,
.arc-modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.95) 0%, rgba(20, 20, 30, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 100, 100, 0.1);
    color: #ff6b6b;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0 0 0.25rem 0;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem 0;
}

/* Form */
.habit-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.label-icon {
    font-size: 1rem;
}

.form-group input,
.form-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #e8e8e8;
    font-size: 0.9rem;
}

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

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(100, 180, 160, 0.5);
}

.submit-btn {
    background: linear-gradient(135deg, #64b4a0, #508cb4);
    border: none;
    border-radius: 12px;
    padding: 0.9rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(100, 180, 160, 0.3);
}

/* Arc Options */
.arc-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.arc-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.arc-option:hover {
    background: rgba(180, 100, 180, 0.1);
    border-color: rgba(180, 100, 180, 0.3);
}

.arc-option-name {
    font-size: 1rem;
    font-weight: 500;
    color: #e8e8e8;
    margin-bottom: 0.25rem;
}

.arc-option-focus {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.empty-state .hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 1.5rem;
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .habit-loop {
        flex-direction: column;
        align-items: stretch;
    }
    
    .loop-arrow {
        transform: rotate(90deg);
        align-self: center;
    }
    
    .arc-weeks {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}

/* =============================================================================
   HABIT NOTIFICATIONS
   ============================================================================= */

.habit-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.95), rgba(30, 30, 40, 0.95));
    border: 1px solid rgba(100, 180, 160, 0.4);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    min-width: 280px;
    max-width: 360px;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.habit-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.habit-notification strong {
    color: #64b4a0;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.25rem;
}

.habit-notification p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}
