/**
 * Aurora Digital Solutions - Portal Styles
 * Based on Aurora Branding Guidelines
 */

/* Color Variables */
:root {
    --aurora-navy: #0E2841;
    --aurora-blue: #156082;
    --aurora-bright-blue: #0F9ED5;
    --aurora-orange: #E97132;
    --aurora-gray: #E8E8E8;
    --aurora-green: #196B24;
    --aurora-purple: #A02B93;
    --aurora-teal: #467886;
    --aurora-dark-bg: #0a1a2b;

    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg-white: #fff;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background-color: var(--aurora-navy);
    color: white;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-section {
    display: flex;
    align-items: center;
}

.logo-section img {
    height: 45px;
    margin-right: 15px;
}

.logo-section h1 {
    font-size: 1.4rem;
    font-weight: 500;
    color: white;
}

nav {
    display: flex;
    gap: 25px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s;
}

nav a:hover,
nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--aurora-orange);
}

/* Main Content */
main {
    flex: 1;
    padding: 30px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Page Title */
.page-title {
    color: var(--aurora-navy);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--aurora-orange);
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 25px;
}

.card-title {
    color: var(--aurora-navy);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--aurora-gray);
}

/* Filters Section */
.filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 25px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--aurora-bright-blue);
    box-shadow: 0 0 0 3px rgba(15, 158, 213, 0.2);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: #d96229;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background-color: var(--aurora-navy);
    color: white;
}

.btn-secondary:hover {
    background-color: #0a1e31;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead {
    background-color: var(--aurora-navy);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 500;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: rgba(15, 158, 213, 0.05);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-success,
.status-succès {
    background-color: rgba(25, 107, 36, 0.15);
    color: var(--aurora-green);
}

.status-error,
.status-echec,
.status-échec {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.status-répondeur {
    background-color: rgba(70, 120, 134, 0.15);
    color: var(--aurora-teal);
}

.status-pending,
.status-en-cours {
    background-color: rgba(15, 158, 213, 0.15);
    color: var(--aurora-bright-blue);
}

/* Statistics Widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-widget {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    text-align: center;
    border-left: 4px solid var(--aurora-orange);
}

.stat-widget .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--aurora-navy);
    margin-bottom: 5px;
}

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

.stat-widget.highlight {
    border-left-color: var(--aurora-bright-blue);
    background: linear-gradient(135deg, rgba(15, 158, 213, 0.05), transparent);
}

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

.charts-full-width {
    margin-top: 25px;
}

.chart-container {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 25px;
}

.chart-container h3 {
    color: var(--aurora-navy);
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-wrapper-wide {
    height: 400px;
}

/* Latency Filter Styles */
.latency-filter-container {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--bg-light);
    border-radius: 6px;
}

.latency-filter-label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.latency-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-label-bold {
    font-weight: 500;
    width: 100%;
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.checkbox-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Landing Page Hero */
.hero {
    background: linear-gradient(135deg, var(--aurora-navy) 0%, var(--aurora-blue) 100%);
    color: white;
    padding: 80px 50px;
    text-align: center;
    margin: -30px -30px 30px -30px;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero .highlight {
    color: var(--aurora-orange);
    font-weight: 500;
}

/* Service Cards */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.service-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.service-card .icon {
    width: 60px;
    height: 60px;
    background-color: var(--aurora-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.service-card h3 {
    color: var(--aurora-navy);
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* CTA Section */
.cta-section {
    background-color: var(--aurora-navy);
    color: white;
    padding: 60px;
    border-radius: 8px;
    text-align: center;
    margin-top: 30px;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

/* Footer */
footer {
    background-color: var(--aurora-dark-bg);
    color: white;
    padding: 25px 30px;
    text-align: center;
    margin-top: auto;
}

footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}

footer a {
    color: var(--aurora-teal);
    text-decoration: none;
}

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

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--aurora-gray);
    border-top-color: var(--aurora-bright-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    main {
        padding: 20px;
    }

    .hero {
        padding: 50px 20px;
        margin: -20px -20px 20px -20px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .page-title {
        font-size: 1.6rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

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

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

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-widget .stat-value {
        font-size: 2rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Diagnostics Utilities */
.diagnostic-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.status-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.status-label.success {
    color: var(--aurora-green);
}

.status-label.error {
    color: #dc3545;
}

.diagnostic-result pre {
    background-color: #11131a;
    color: #dfe6f0;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9rem;
}

.list-disc {
    list-style: disc;
    padding-left: 20px;
    color: var(--text-secondary);
}

.list-disc li {
    margin-bottom: 8px;
}