/* StabilityTracker.com - Professional Medical Tracking System */
/* Modern, Clinical Design */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --success: #10b981;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e9ff 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo svg {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.logo h1 span {
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
    font-size: 14px;
}

.user-info svg {
    stroke: var(--gray-500);
}

.role-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-left: 4px;
}

.btn-logout {
    padding: 8px 16px;
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--gray-200);
}

/* Navigation */
.main-nav {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0;
}

.main-nav .container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.nav-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--primary);
    background: var(--gray-50);
}

.nav-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Main Content */
.main-content {
    padding: 32px 0;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

.status-badge {
    padding: 6px 12px;
    background: var(--success);
    color: white;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
}

.status-badge.active {
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Medication Cards */
.med-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.med-card {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary);
}

.med-card.vraylar {
    border-left-color: #8b5cf6;
}

.med-card.lamictal {
    border-left-color: #06b6d4;
}

.med-icon {
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.med-card.vraylar .med-icon {
    background: #ede9fe;
}

.med-card.vraylar .med-icon svg {
    stroke: #8b5cf6;
}

.med-card.lamictal .med-icon {
    background: #cffafe;
}

.med-card.lamictal .med-icon svg {
    stroke: #06b6d4;
}

.med-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.med-card .dosage {
    font-size: 16px;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.med-card .disc-date {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.med-card .days-since {
    font-size: 16px;
    color: var(--gray-700);
}

.med-card .days-since strong {
    font-size: 32px;
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
}

/* Alert Boxes */
.alert-box {
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.alert-box svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-box.warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
}

.alert-box.warning svg {
    stroke: #f59e0b;
}

.alert-box.info {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e3a8a;
}

.alert-box.info svg {
    stroke: #2563eb;
}

.alert-box h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-box p {
    font-size: 14px;
    line-height: 1.5;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
}

.stat-icon {
    stroke: var(--gray-400);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

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

/* Recent Activity */
.recent-activity {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.recent-activity h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gray-900);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    min-width: 60px;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.activity-content .notes {
    color: var(--gray-600);
    font-style: italic;
}

.no-data {
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
    padding: 40px 20px;
}

/* Forms */
.entry-form {
    background: white;
    padding: 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 20px;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.rating-slider {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-slider input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    outline: none;
    -webkit-appearance: none;
}

.rating-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.rating-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

.rating-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    min-width: 30px;
    text-align: center;
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.rating-labels span {
    font-size: 12px;
    color: var(--gray-500);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-delete {
    padding: 6px 12px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

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

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.save-status {
    font-size: 14px;
    color: var(--success);
    font-weight: 500;
}

/* Symptoms */
.symptoms-info {
    margin-bottom: 24px;
}

.symptoms-today,
.symptoms-history {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.symptoms-today h3,
.symptoms-history h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gray-900);
}

.symptoms-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.symptom-item {
    padding: 16px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--gray-300);
    background: var(--gray-50);
}

.symptom-item.severity-1,
.symptom-item.severity-2,
.symptom-item.severity-3 {
    border-left-color: var(--success);
    background: #f0fdf4;
}

.symptom-item.severity-4,
.symptom-item.severity-5,
.symptom-item.severity-6 {
    border-left-color: var(--warning);
    background: #fef3c7;
}

.symptom-item.severity-7,
.symptom-item.severity-8,
.symptom-item.severity-9,
.symptom-item.severity-10 {
    border-left-color: var(--danger);
    background: #fee2e2;
}

.symptom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.symptom-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.severity-badge {
    padding: 4px 8px;
    background: white;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 600;
}

.symptom-notes {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 12px;
    line-height: 1.5;
}

.symptom-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.symptom-time,
.symptom-date {
    font-size: 12px;
    color: var(--gray-500);
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-card {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.chart-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gray-900);
}

.chart-card canvas {
    max-height: 300px;
}

/* Export */
.export-section {
    max-width: 800px;
}

.export-actions {
    margin: 32px 0;
    text-align: center;
}

.export-summary {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.export-summary h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gray-900);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.summary-item {
    text-align: center;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
}

.summary-item strong {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.summary-item span {
    font-size: 14px;
    color: var(--gray-600);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 480px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-large {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.login-header h1 span {
    color: var(--primary);
}

.login-header p {
    font-size: 14px;
    color: var(--gray-600);
}

.login-form {
    margin-bottom: 24px;
}

.error-message {
    padding: 12px;
    background: #fee2e2;
    border: 1px solid #ef4444;
    border-radius: var(--border-radius);
    color: #991b1b;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message svg {
    flex-shrink: 0;
    stroke: #ef4444;
}

.login-footer {
    border-top: 1px solid var(--gray-200);
    padding-top: 24px;
}

.credentials-info {
    margin-bottom: 20px;
}

.credentials-info > p {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.cred-box {
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
}

.cred-box p {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.6;
}

.cred-box code {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--primary);
    border: 1px solid var(--gray-200);
}

.security-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-500);
    justify-content: center;
}

.security-note svg {
    stroke: var(--gray-400);
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 12px;
    }
    
    .main-nav .container {
        flex-wrap: wrap;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .med-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media print {
    .header,
    .main-nav,
    .btn-primary,
    .btn-secondary,
    .btn-delete,
    .form-actions {
        display: none;
    }
    
    .view {
        display: block !important;
    }
    
    body {
        background: white;
    }
    
    .main-content {
        padding: 0;
    }
}
