/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Root Variables for Consistent Design */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --sleep-gradient: linear-gradient(135deg, #667eea 0%, #8b5cf6 100%);
    --impact-gradient: linear-gradient(135deg, #f59e0b 0%, #e11d48 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Body and Background */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f23;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 20s infinite ease-in-out;
    opacity: 0.6;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #667eea, #764ba2);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #f093fb, #f5576c);
    top: 60%;
    right: 10%;
    animation-delay: -7s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #4facfe, #00f2fe);
    bottom: 20%;
    left: 30%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(90deg); }
    50% { transform: translate(-20px, 20px) rotate(180deg); }
    75% { transform: translate(40px, 10px) rotate(270deg); }
}

/* Floating Particles */
.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: floatUp 15s infinite linear;
}

.particle:nth-child(1) { width: 4px; height: 4px; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 6px; height: 6px; left: 30%; animation-delay: -3s; }
.particle:nth-child(3) { width: 3px; height: 3px; left: 60%; animation-delay: -6s; }
.particle:nth-child(4) { width: 5px; height: 5px; left: 80%; animation-delay: -9s; }
.particle:nth-child(5) { width: 4px; height: 4px; left: 90%; animation-delay: -12s; }

@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

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

/* Header with Glassmorphism */
.header {
    padding: 40px 0;
    position: relative;
    backdrop-filter: blur(20px);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 30px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glass);
}

.heartbeat-icon {
    width: 30px;
    height: 30px;
    color: white;
}

.heartbeat-pulse {
    animation: heartbeat 2s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.logo-text h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 5px;
}

.logo-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.disclaimer {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
}

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

/* Navigation */
.nav-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    background: var(--glass-bg);
    padding: 8px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.tab-icon {
    font-size: 1.1rem;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.glass-card:hover::before {
    left: 100%;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.25);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

/* Tracker Grid */
.tracker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Body Map */
.body-map-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-glass);
}

.card-header {
    text-align: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.card-header p {
    color: var(--text-secondary);
}

.body-diagram {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.body-svg {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

/* Body Parts */
.body-part {
    fill: rgba(102, 126, 234, 0.3);
    stroke: rgba(102, 126, 234, 0.6);
    stroke-width: 2;
    transition: var(--transition);
    cursor: pointer;
}

.body-part.hoverable:hover {
    fill: rgba(102, 126, 234, 0.6);
    stroke: #667eea;
    stroke-width: 3;
    filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.8));
    transform: scale(1.05);
}

.body-part.selected {
    fill: rgba(245, 87, 108, 0.7);
    stroke: #f5576c;
    stroke-width: 3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { filter: drop-shadow(0 0 5px rgba(245, 87, 108, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(245, 87, 108, 0.8)); }
    100% { filter: drop-shadow(0 0 5px rgba(245, 87, 108, 0.5)); }
}

.body-label {
    fill: var(--text-primary);
    text-anchor: middle;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
}

.body-label.small {
    font-size: 10px;
}

/* Symptom Form */
.symptom-form-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-glass);
    position: sticky;
    top: 20px;
}

.symptom-form {
    animation: slideIn 0.4s ease-out;
}

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

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.selected-region-display {
    background: var(--primary-gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: capitalize;
}

.form-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-input, .form-textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

/* Specific styling for select dropdown */
select.form-input {
    color: #000000;
    background: rgba(255, 255, 255, 0.9);
}

select.form-input option {
    color: #000000;
    background: #ffffff;
}

/* NEW: Life Impact Section Styles */
.life-impact-section {
    background: rgba(245, 87, 108, 0.05);
    border: 1px solid rgba(245, 87, 108, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.life-impact-section .form-label {
    color: #f093fb;
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
}

.impact-category {
    margin-bottom: 20px;
}

.impact-category h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #f093fb;
    background: var(--impact-gradient);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

/* NEW: Sleep Tracker Styles */
.sleep-form-card, .sleep-stats-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-glass);
}

.sleep-form-card .card-icon {
    color: #8b5cf6;
}

.sleep-quality-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sleep-timeline-container {
    margin-top: 20px;
}

.sleep-timeline-container h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sleep-item {
    border-left-color: var(--sleep-gradient) !important;
}

/* Severity Slider */
.severity-slider {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
    transition: var(--transition);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.6);
}

.severity-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 80px;
}

.severity-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.severity-label, .sleep-quality-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.btn-icon {
    font-size: 1.1rem;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.form-actions .btn-primary {
    flex: 1;
}

.form-actions .btn-secondary {
    flex: 0 0 auto;
    padding: 12px 20px;
}

/* Instruction Card */
.instruction-card {
    text-align: center;
    padding: 40px 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-glass);
}

.instruction-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.instruction-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.instruction-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.quick-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #4facfe;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* History and Appointment Grids */
.history-grid, .appointment-grid, .reports-grid {
    display: grid;
    gap: 30px;
    margin-top: 30px;
}

.appointment-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.reports-grid {
    grid-template-columns: 1fr 1fr;
}

.history-grid {
    grid-template-columns: 2fr 1fr;
}

.prep-card {
    position: relative;
}

.prep-card.full-width {
    grid-column: 1 / -1;
}

.prep-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* History Controls */
.history-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--glass-bg);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* Timeline */
.timeline-card, .patterns-card, .report-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-glass);
}

.timeline {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.timeline::-webkit-scrollbar {
    width: 6px;
}

.timeline::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.timeline::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 3px;
}

/* Questions List */
.questions-list {
    margin-bottom: 20px;
}

.suggested-question {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.suggested-question:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.add-question {
    display: flex;
    gap: 10px;
}

.add-question .form-input {
    flex: 1;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.checkbox-item input[type="checkbox"]:checked + .checkmark {
    background: var(--success-gradient);
    border-color: #4facfe;
}

.checkbox-item input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* NEW: Export Section Styles */
.export-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.export-section h4 {
    color: #c4b5fd;
    margin-bottom: 15px;
    font-size: 1rem;
}

.export-section .btn-secondary {
    background: var(--impact-gradient);
    color: white;
    border: none;
}

.export-section .btn-secondary:hover {
    background: var(--secondary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

/* Report Preview */
.report-preview {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.preview-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--secondary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
    transition: var(--transition);
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 35px rgba(245, 87, 108, 0.6);
}

.fab-icon {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.fab-tooltip {
    position: absolute;
    right: 70px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.fab:hover .fab-tooltip {
    opacity: 1;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-gradient);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(400px);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10000;
}

.toast.show {
    transform: translateX(0);
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Authentication Styles */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
}

.auth-card {
    max-width: 400px;
    width: 90%;
    padding: 40px;
    text-align: center;
}

.auth-header {
    margin-bottom: 30px;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.auth-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.google-btn {
    background: white;
    color: #333;
}

.google-icon {
    width: 20px;
    height: 20px;
}

.auth-divider {
    text-align: center;
    color: var(--text-secondary);
    margin: 10px 0;
}

.user-profile {
  position: fixed;
  top: 12px;
  right: 12px;
  display: none;       /* toggled to flex in JS */
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  z-index: 9000;       /* below .toast (10000) so notifications show above */

  /* transparent glassy look without backdrop blur */
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

.user-avatar { 
  width: 32px; 
  height: 32px; 
  border-radius: 50%; 
  object-fit: cover; 
}
.user-name { font-weight: 600; }
.user-email { opacity: .8; font-size: .9rem; }


/* Optional: make the chip fully transparent and click-through when needed */
.user-profile.clear-overlay{
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;   /* clicks go to elements behind */
  z-index: 8000;          /* keep it below toasts/tooltips */
}


.privacy-notice {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tracker-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .history-grid, .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .appointment-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
    
    .logo-section {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .logo-text h1 {
        font-size: 2rem;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .fab-icon {
        font-size: 1.2rem;
    }
    
    .radio-group {
        grid-template-columns: 1fr;
    }
    
    .life-impact-section {
        padding: 15px;
    }
    
    .export-section > div {
        flex-direction: column;
        gap: 10px;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    body {
        background: #000011;
    }
    
    .animated-bg {
        background: linear-gradient(135deg, #000011 0%, #1a0a2e 25%, #0f1419 50%, #0a0f1c 75%, #000011 100%);
    }
}

/* Additional Animations */
.glass-card {
    animation: cardFloat 6s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.body-part:hover {
    animation: bodyPartGlow 1.5s ease-in-out infinite;
}

@keyframes bodyPartGlow {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(102, 126, 234, 0.3)); }
    50% { filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.8)); }
}

/* Advanced Form Styling */
.form-input:focus {
    animation: inputFocus 0.3s ease-out;
}

@keyframes inputFocus {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Micro-interactions */
.btn-primary:active {
    transform: translateY(0px) scale(0.98);
}

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

.radio-option:active {
    transform: scale(0.98);
}

/* Life Impact Visual Enhancements */
.impact-category:nth-child(1) .radio-option input[type="radio"]:checked + .radio-custom {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.impact-category:nth-child(2) .radio-option input[type="radio"]:checked + .radio-custom {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.impact-category:nth-child(3) .radio-option input[type="radio"]:checked + .radio-custom {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.impact-category:nth-child(4) .radio-option input[type="radio"]:checked + .radio-custom {
    background: linear-gradient(135deg, #10b981, #059669);
}

.impact-category:nth-child(5) .radio-option input[type="radio"]:checked + .radio-custom {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
/* Enhanced photo display styles for timeline */
.timeline-item img {
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-item img:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Photo size warning */
.photo-size-warning {
    color: rgba(255, 193, 7, 0.8);
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

/* Loading state for photo processing */
.photo-processing {
    opacity: 0.6;
    pointer-events: none;
}

/* Photo preview enhancements */
.preview-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(79, 172, 254, 0.3);
    transition: all 0.3s ease;
}

.preview-image:hover {
    border-color: rgba(79, 172, 254, 0.6);
    transform: scale(1.02);
}

/* Photo meta info */
.photo-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
    text-align: center;
}

/* Responsive photo display */
@media (max-width: 768px) {
    .timeline-item img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .preview-image {
        max-width: 150px;
        max-height: 150px;
    }
}

/* Enhanced photo display styles for timeline */
.timeline-item img {
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-item img:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Photo size warning */
.photo-size-warning {
    color: rgba(255, 193, 7, 0.8);
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

/* Loading state for photo processing */
.photo-processing {
    opacity: 0.6;
    pointer-events: none;
}

/* Photo preview enhancements */
.preview-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(79, 172, 254, 0.3);
    transition: all 0.3s ease;
}

.preview-image:hover {
    border-color: rgba(79, 172, 254, 0.6);
    transform: scale(1.02);
}

/* Photo meta info */
.photo-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
    text-align: center;
}

/* Responsive photo display */
@media (max-width: 768px) {
    .timeline-item img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .preview-image {
        max-width: 150px;
        max-height: 150px;
    }
}
/* Photo Upload Styles */
.photo-upload-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.photo-input {
    display: none;
}

.photo-upload-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.photo-upload-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.photo-preview {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.remove-photo-btn {
    background: rgba(239, 68, 68, 0.8);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.remove-photo-btn:hover {
    background: rgba(239, 68, 68, 1);
}

.medical-icon {
    width: 30px;
    height: 30px;
    color: white;
}

/* ==================== MEDICATION SECTION STYLES ==================== */

.medications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.medication-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.medication-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.medication-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.medication-header h4 {
    color: #c4b5fd;
    font-size: 1.2rem;
    margin: 0;
}

.medication-dosage {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.medication-info {
    margin: 15px 0;
}

.medication-info p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.medication-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.med-action-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.med-notify-btn {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.med-notify-btn:hover {
    background: rgba(156, 163, 175, 0.3);
    color: #d1d5db;
}

.med-notify-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    animation: pulse 2s infinite;
}

.med-notify-active:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.med-delete-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.med-delete-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    transform: translateY(-2px);
}

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

/* Form Row for Medication Form */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .medications-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}