/* ==========================================================================
   MeeDoo Documentation Page Styles
   ========================================================================== */

/* --- Page Layout & Overrides --- */
.docs-page {
    background-color: var(--bg-color); /* Hérite du thème noir/clair */
    color: var(--text-color);
    padding-top: 80px; /* Espace pour le header fixe */
}

.docs-layout {
    display: flex;
    max-width: 1400px; /* Un peu plus large pour la doc */
    margin: 0 auto;
    padding: 3rem 1.5rem;
    gap: 3rem;
}

/* --- Header de la Documentation --- */
.docs-header {
    background-color: var(--header-bg);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1001;
}
.docs-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.docs-nav-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #00b169; /* Vert vif pour le statut */
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* --- Sidebar --- */
.docs-sidebar {
    flex: 0 0 280px;
    position: sticky;
    top: 100px; /* Juste en dessous du header fixe */
    height: fit-content;
}
.docs-search input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    margin-bottom: 2rem;
    font-family: var(--font-family-sans);
}
.docs-nav ul { list-style: none; }
.docs-nav > ul > li { margin-bottom: 1.5rem; }
.docs-nav > ul > li > a {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    display: block;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}
.docs-nav > ul > li > a:hover { color: var(--primary-color); }
.docs-nav ul ul {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}
.docs-nav ul ul a {
    font-size: 0.9rem;
    color: var(--text-color-light);
    display: block;
    padding: 0.3rem 0;
    transition: color 0.3s ease;
}
.docs-nav ul ul a:hover { color: var(--primary-color); }

/* --- Main Content --- */
.docs-content {
    flex: 1;
}
.docs-content h1, .docs-content h2, .docs-content h3 {
    font-family: var(--font-family-serif);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: 100px; /* Pour le scroll ancré */
}
.docs-content h1 {
    font-size: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.docs-content h2 { font-size: 1.8rem; }
.docs-content h3 { font-size: 1.5rem; font-family: var(--font-family-sans); color: var(--primary-color); }

.docs-content p, .docs-content ul, .docs-content ol { max-width: 800px; }
.docs-content p { margin-bottom: 1.5rem; line-height: 1.8; }
.docs-content ul, .docs-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}
.docs-content li { margin-bottom: 0.8rem; }
.docs-content code {
    background-color: var(--light-bg);
    color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

/* --- Re-usable Cards for Docs Content --- */
.docs-content .card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.docs-content .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.docs-content .card h4 {
    font-family: var(--font-family-sans);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}
.docs-content .card code {
    font-family: var(--font-family-sans);
    font-size: 1rem;
    padding: 0;
    background: none;
    color: var(--text-color);
}

/* --- Styles for the API Status Page --- */

.api-status-header {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.status-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.status-subtitle {
    font-size: 1.1rem;
    color: var(--text-color-light);
}

.status-indicator {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
}
.status-indicator.online { background-color: #28a745; }
.status-indicator.degraded { background-color: #ffc107; }
.status-indicator.down { background-color: #dc3545; }
.status-indicator.scheduled { background-color: #17a2b8; }


/* Metrics Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}
.metric-card {
    text-align: center;
}
.metric-value {
    font-family: var(--font-family-sans);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    animation: slowPulse 2s infinite ease-in-out;
}
@keyframes slowPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}
.metric-label {
    font-size: 1rem;
    color: var(--text-color-light);
}

/* Uptime Graph */
.uptime-graph {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}
#uptime-chart { max-width: 100%; }


/* Incidents */
.incident-list {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}
.incident summary {
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1.5rem;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-left: 2rem;
    transition: background-color 0.3s ease;
}
.incident summary:hover {
    background-color: var(--light-bg);
}
.incident summary::before {
    content: '▶';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color-light);
}
.incident[open] summary::before { content: '▼'; }

.incident details {
    padding: 0 1.5rem 1.5rem;
    border-left: 4px solid var(--border-color);
    margin-left: 1.5rem;
}
.incident-details p {
    margin-bottom: 1rem;
    color: var(--text-color-light);
}
.incident-details strong { color: var(--text-color); }

.incident.disabled summary {
    font-style: italic;
    color: var(--text-color-light);
    opacity: 0.7;
    cursor: default;
}

/* Responsive */
@media (max-width: 768px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .status-title { font-size: 2rem; }
}


/* --- Code Blocks --- */
.code-block-container { position: relative; margin: 2rem 0; }
.code-block-container pre {
    background-color: #1a1a1a; /* Un noir moins dur pour le code */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.7;
}
.copy-button {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 14px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-family-sans);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.copy-button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.copy-button.copied { background-color: #00b169; }

/* --- Parameters Table --- */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.5rem 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.params-table th, .params-table td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}
.params-table th {
    background-color: var(--light-bg);
    font-family: var(--font-family-sans);
    font-weight: 600;
    color: var(--text-color);
}
.params-table td {
    color: var(--text-color-light);
}
.params-table tr:last-child td { border-bottom: none; }

/* --- Alert Boxes --- */
.alert {
    padding: 1.25rem 1.75rem;
    margin: 2rem 0;
    border-radius: 8px;
    border-left: 5px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.alert::before {
    content: "⚠️";
    font-size: 1.2rem;
}
.alert strong { display: block; margin-bottom: 0; color: inherit; }
.alert-warning {
    background-color: #2d1b0b;
    border-left-color: #ffc107;
    color: #f6e05e;
}

/* --- SDK Grid --- */
.sdk-grid .card { text-align: center; }
.sdk-grid .card h3 { color: var(--primary-color); }

/* --- Footer (re-use main footer styles) --- */
/* Pas de styles supplémentaires nécessaires ici, car il utilise .footer de style.css */

/* --- Responsive Design for Docs --- */
@media (max-width: 1024px) {
    .docs-layout {
        flex-direction: column;
        padding: 2rem 1rem;
        gap: 2rem;
    }
    .docs-sidebar {
        flex: none;
        width: 100%;
        position: static;
        order: 2;
    }
    .docs-content {
        order: 1;
        padding: 0;
    }
    .docs-content h1 { font-size: 2rem; }
}
