/**
 * Her Health, Clearly - Tracker Base Styles
 * Shared CSS for all HTML tracker files
 * Version: 1.0
 */

/* ============================================
   CSS VARIABLES - Brand Colors & Typography
============================================ */
:root {
    /* Typography */
    --font-serif: 'Libre Baskerville', Georgia, serif;
    --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
    
    /* Core Colors */
    --charcoal: #1a1a1a;
    --warm-gray: #6c757d;
    --light-gray: #f8f9fa;
    --white: #ffffff;
    --border: #dfe4e8;
    
    /* Primary Accent - Sage */
    --sage: #7a9878;
    --sage-dark: #5a7856;
    --sage-light: #e8f0e7;
    
    /* Secondary Accents */
    --terracotta: #d4896b;
    --terracotta-light: #fef2ed;
    --rose: #e8a5a5;
    --rose-light: #fef5f5;
    --lavender: #b5a5d5;
    --lavender-light: #f5f9f9;
    --gold: #d4b76b;
    --gold-light: #fef9ed;
    
    /* Shadows */
    --shadow: rgba(26, 26, 26, 0.08);
    --shadow-md: 0 4px 12px rgba(26, 26, 26, 0.1);
    --shadow-lg: 0 8px 32px rgba(26, 26, 26, 0.08);
}

/* ============================================
   BASE RESET & TYPOGRAPHY
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--charcoal);
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
    padding: 2rem 1rem;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    color: var(--charcoal);
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ============================================
   CONTAINER & LAYOUT
============================================ */
.container {
    max-width: 850px;
    margin: 0 auto;
    background: var(--white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.6s ease-out;
}

.container--wide {
    max-width: 1200px;
}

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

/* ============================================
   HEADER & LOGO
============================================ */
.header {
    border-bottom: 3px solid var(--sage);
    padding-bottom: 2rem;
    margin-bottom: 3rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sage-dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--sage-light);
}

.back-button:hover {
    background: var(--sage);
    color: white;
    transform: translateX(-4px);
}

.logo {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.logo img {
    height: 48px;
    width: auto;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--warm-gray);
    font-weight: 400;
    line-height: 1.5;
    max-width: 600px;
}

/* ============================================
   SECTIONS
============================================ */
.section {
    margin-bottom: 3rem;
    animation: slideIn 0.5s ease-out backwards;
}

.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.3s; }
.section:nth-child(5) { animation-delay: 0.4s; }
.section:nth-child(6) { animation-delay: 0.5s; }
.section:nth-child(7) { animation-delay: 0.6s; }
.section:nth-child(8) { animation-delay: 0.7s; }

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

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--sage-light);
}

.section-number {
    width: 36px;
    height: 36px;
    background: var(--sage);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--charcoal);
}

/* ============================================
   FORM ELEMENTS
============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.label-description {
    font-weight: 400;
    color: var(--warm-gray);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--charcoal);
    background: var(--white);
    transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(122, 152, 120, 0.15);
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--sage-dark);
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

textarea.large {
    min-height: 180px;
}

/* Checkboxes & Radios */
input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--sage);
    cursor: pointer;
}

.checkbox-group {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.checkbox-item:hover {
    border-color: var(--sage);
    background: var(--sage-light);
}

.checkbox-label {
    font-size: 1rem;
    color: var(--charcoal);
    cursor: pointer;
    flex: 1;
}

/* Severity Scale */
.severity-scale {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.severity-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.severity-label {
    font-size: 0.9rem;
    color: var(--charcoal);
    cursor: pointer;
}

/* Range Sliders */
.symptom-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.symptom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sage);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease;
}

.symptom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--warm-gray);
    margin-top: 0.5rem;
}

/* ============================================
   INFO BOXES
============================================ */
.info-box {
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 4px solid;
    margin-bottom: 1.5rem;
}

.info-box--tip {
    background: var(--gold-light);
    border-left-color: var(--gold);
}

.info-box--warning {
    background: var(--terracotta-light);
    border-left-color: var(--terracotta);
}

.info-box--success {
    background: var(--sage-light);
    border-left-color: var(--sage);
}

.info-box--info {
    background: var(--lavender-light);
    border-left-color: var(--lavender);
}

.info-box-title {
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box-content {
    color: var(--charcoal);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   BUTTONS
============================================ */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--sage);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--sage-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--sage);
    border: 2px solid var(--sage);
}

.btn-secondary:hover {
    background: var(--sage-light);
    transform: translateY(-2px);
}

.btn-tertiary {
    background: var(--light-gray);
    color: var(--charcoal);
}

.btn-tertiary:hover {
    background: var(--border);
    transform: translateY(-2px);
}

/* ============================================
   TABLES
============================================ */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.summary-table th,
.summary-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.summary-table th {
    background: var(--sage-light);
    font-weight: 600;
    color: var(--charcoal);
}

.summary-table tr:hover {
    background: var(--light-gray);
}

/* ============================================
   CALENDAR COMPONENTS
============================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--warm-gray);
    padding: 0.5rem;
    font-size: 0.85rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.calendar-day:hover {
    border-color: var(--sage);
    background: var(--sage-light);
}

.calendar-day.today {
    border-color: var(--sage);
    font-weight: 700;
}

.calendar-day.has-data {
    background: var(--sage-light);
}

/* ============================================
   PRINT STYLES
============================================ */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        max-width: 100%;
        box-shadow: none;
        padding: 1.5rem;
        border-radius: 0;
    }

    .action-buttons,
    .back-button,
    .btn,
    .no-print {
        display: none !important;
    }

    .section {
        page-break-inside: avoid;
        animation: none;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    input[type="text"],
    input[type="date"],
    textarea,
    select {
        border: none;
        border-bottom: 1px solid #ccc;
        border-radius: 0;
        padding: 0.25rem 0;
    }

    .checkbox-item {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* ============================================
   RESPONSIVE STYLES
============================================ */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    .container {
        padding: 2rem 1.5rem;
        border-radius: 0;
    }

    h1 {
        font-size: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .severity-scale {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

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

    .logo img {
        height: 36px;
    }
}

/* ============================================
   SUCCESS MESSAGE (Toast)
============================================ */
.success-message {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--sage-dark);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
    z-index: 1000;
}

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

/* ============================================
   SYMPTOM TRACKING INDICATORS
============================================ */
.indicator-bleeding { background: var(--rose); }
.indicator-pain { background: var(--terracotta); }
.indicator-mood { background: var(--lavender); }
.indicator-physical { background: var(--sage); }

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
