/* Space Weather Analysis - Responsive CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --text-color: #2c3e50;
    --text-light: #495057;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

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

/* Main content container */
.main-content {
    /* Remove sidebar-related styles */
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px 0;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}


.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.header .subtitle {
    font-size: 1.2rem;
    text-align: center;
    opacity: 0.9;
}

.header .timestamp {
    font-size: 0.9rem;
    text-align: center;
    margin-top: 10px;
    opacity: 0.8;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.card-body {
    padding: 25px;
}

/* Threat Level Indicators */
.threat-level {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.threat-low { background: var(--success-color); color: white; }
.threat-moderate { background: var(--warning-color); color: white; }
.threat-high { background: var(--danger-color); color: white; }
.threat-severe { background: #8b0000; color: white; }

/* Key Findings */
.key-findings {
    list-style: none;
    margin: 20px 0;
}

.key-findings li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 20px;
}

.key-findings li:before {
    content: "▶";
    color: var(--accent-color);
    font-size: 0.8rem;
    position: absolute;
    left: 0;
    top: 12px;
}

.key-findings li:last-child {
    border-bottom: none;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 30px;
    margin-bottom: 30px;
}

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

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

/* Parameter Tables */
.param-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.param-table th,
.param-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.param-table th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--text-color);
}

.param-table tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-quiet { background: #d4edda; color: #155724; }
.status-unsettled { background: #fff3cd; color: #856404; }
.status-active { background: #f8d7da; color: #721c24; }
.status-storm { background: #f5c6cb; color: #721c24; }
.status-low { background: #d4edda; color: #155724; }
.status-moderate { background: #fff3cd; color: #856404; }
.status-high { background: #f8d7da; color: #721c24; }
.status-severe { background: #f5c6cb; color: #721c24; }

/* Recommendations */
.recommendations {
    list-style: none;
    margin: 20px 0;
}

.recommendations li {
    background: var(--light-bg);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.recommendations.immediate li {
    border-left-color: var(--danger-color);
}

.recommendations.monitoring li {
    border-left-color: var(--warning-color);
}

.recommendations.planning li {
    border-left-color: var(--info-color);
}

/* Timeline */
.timeline {
    margin: 20px 0;
}

.timeline-item {
    border-left: 3px solid var(--accent-color);
    padding-left: 20px;
    margin-bottom: 25px;
    position: relative;
}

.timeline-item:before {
    content: "";
    position: absolute;
    left: -7px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
}

.timeline-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.timeline-item .risk-level {
    margin-bottom: 10px;
}

.timeline-events {
    list-style: none;
    margin-top: 10px;
}

.timeline-events li {
    padding: 5px 0;
    color: var(--text-light);
}

/* Mobile and Small Tablet Layout */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header .subtitle {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .param-table {
        font-size: 0.9rem;
    }
    
    .param-table th,
    .param-table td {
        padding: 8px;
    }
}

/* Small Mobile Layout */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px 0;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .threat-level {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .param-table {
        font-size: 0.8rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .header {
        background: white;
        color: black;
        border-bottom: 2px solid black;
    }
    
    .card-header {
        background: #f0f0f0;
        color: black;
    }
    
    .threat-level,
    .status-indicator {
        background: #f0f0f0 !important;
        color: black !important;
        border: 1px solid #ccc;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: white;
    padding: 40px 0;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

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

.footer-content p {
    margin-bottom: 15px;
}

.footer-content ul {
    list-style: none;
    margin: 20px 0;
}

.footer-content ul li {
    margin-bottom: 8px;
}

.footer-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

.disclaimer {
    font-size: 0.9rem;
    color: #adb5bd;
    margin-top: 20px;
    font-style: italic;
}

/* Glossary Terms */
.glossary-term {
    color: var(--accent-color);
    cursor: help;
    border-bottom: 1px dotted var(--accent-color);
    position: relative;
    transition: all 0.2s ease;
    text-decoration: none;
}

.glossary-term:hover,
.glossary-term:focus {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: var(--dark-bg);
    color: white;
    padding: 15px;
    border-radius: 8px;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-term {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 8px;
    display: block;
}

.tooltip-definition {
    margin-bottom: 8px;
}

.tooltip-units {
    font-style: italic;
    color: #adb5bd;
    font-size: 0.8rem;
}

.tooltip-category {
    background: var(--accent-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 8px;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--dark-bg);
}

/* Glossary Section */
.glossary-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.glossary-toggle {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease;
    margin-bottom: 20px;
}

.glossary-toggle:hover {
    background: var(--primary-color);
}

.glossary-content {
    display: none;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.glossary-content.show {
    display: block;
}

.glossary-search {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 1rem;
}

.glossary-category {
    margin-bottom: 40px;
}

.glossary-category h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    font-size: 1.4rem;
}

.glossary-category h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

.glossary-terms {
    display: grid;
    gap: 20px;
}

.glossary-term-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glossary-term-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.glossary-term-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.glossary-term-definition {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 15px;
}

.glossary-term-units,
.glossary-term-context,
.glossary-term-gnss {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.glossary-term-units {
    background: #e8f4fd;
    border-left: 3px solid var(--info-color);
}

.glossary-term-context {
    background: #fff3cd;
    border-left: 3px solid var(--warning-color);
}

.glossary-term-gnss {
    background: #d4edda;
    border-left: 3px solid var(--success-color);
}

.glossary-term-units strong,
.glossary-term-context strong,
.glossary-term-gnss strong {
    color: var(--primary-color);
}

/* Search Results */
.search-results {
    margin-top: 10px;
    padding: 10px;
    background: var(--light-bg);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.search-results p {
    margin: 0;
}

/* Search highlighting */
mark {
    background: #ffeb3b;
    color: #333;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Glossary-specific responsive design */
@media (max-width: 768px) {
    .glossary-category h3 {
        font-size: 1.2rem;
    }
    
    .glossary-term-item {
        padding: 15px;
    }
    
    .glossary-term-name {
        font-size: 1rem;
    }
    
    .glossary-term-units,
    .glossary-term-context,
    .glossary-term-gnss {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* Form Styles */
.contact-form {
    max-width: 800px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

.form-group button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group button:hover {
    background: var(--primary-color);
}

/* Checkbox styling */
.checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal !important;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0;
    margin-top: 3px;
}

.checkbox-label .checkmark {
    flex-shrink: 0;
}


/* Responsive form adjustments */
@media (max-width: 768px) {
    .contact-form .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
    }
}

/* Accessibility improvements */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus indicators for keyboard navigation */
.card:focus-within {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

a:focus,
button:focus,
input:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.glossary-term:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 1px;
    border-radius: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Graph container styling */
.graph-container {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.graph-container img {
    max-width: none !important;
    width: 100% !important;
    height: auto;
    display: block;
}

/* Responsive graph sizing */
@media (max-width: 768px) {
    .graph-container {
        margin-left: -20px;
        margin-right: -20px;
        border-radius: 0;
    }
    
    .graph-container img {
        border-radius: 0;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-light: #000;
    }
    
    .card {
        border: 2px solid #000;
    }
    
    .glossary-term {
        border-bottom: 2px solid;
    }
}