/* 
 * Main Stylesheet for Scientifics.io BoloAPI
 * Brand Colors: Navy Blue (#3d4461)
 */

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

:root {
    --primary-color: #3d4461;
    --primary-hover: #2d3451;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --border-color: #e9ecef;
    --text-color: #212529;
    --text-muted: #6c757d;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
}

/* ============================================================================
   LAYOUT COMPONENTS
   ============================================================================ */

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.nav a:hover {
    opacity: 0.8;
}

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

/* Footer */
.footer {
    background-color: var(--light-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 0.5rem;
}

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

/* ============================================================================
   CONTENT SECTIONS
   ============================================================================ */

.content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.content h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.content h2 {
    color: var(--primary-color);
    /* margin-top: 1rem; */
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.content h3 {
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.content p {
    margin-bottom: 1rem;
}

.content ul, .content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.5rem;
}

/* ============================================================================
   ALERTS & MESSAGES
   ============================================================================ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: var(--info-color);
    color: #0c5460;
}

.alert strong {
    font-weight: 600;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

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

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

.btn-secondary:hover {
    background-color: #5a6268;
}

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

.btn-success:hover {
    background-color: #218838;
}

.btn-warning {
    background-color: var(--warning-color);
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

/* ============================================================================
   CODE BLOCKS
   ============================================================================ */

.code-block {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ============================================================================
   API KEY DISPLAY
   ============================================================================ */

.api-key-display {
    background-color: var(--light-bg);
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    word-break: break-all;
    margin: 1.5rem 0;
    user-select: all;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

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

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

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

.text-muted {
    color: var(--text-muted);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .content h1 {
        font-size: 1.5rem;
    }
    
    .content h2 {
        font-size: 1.25rem;
    }
    
    .api-key-display {
        font-size: 0.9rem;
        padding: 1rem;
    }
    
    .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ============================================================================
   TABLES
   ============================================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--light-bg);
    font-weight: 600;
    color: var(--primary-color);
}

tr:hover {
    background-color: var(--light-bg);
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.card-body {
    color: var(--text-color);
}

/* ============================================================================
   BADGES
   ============================================================================ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: #212529;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

/* ============================================================================
   STATIC PAGES STYLES
   Add this to your existing static/css/main.css file
   ============================================================================ */

/* Static Page Layout */
.content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.content h1 {
    color: #3d4461;
    font-size: 2.5em;
    margin-bottom: 30px;
    border-bottom: 3px solid #3d4461;
    padding-bottom: 15px;
}

/* Section Styles */
.section {
    margin-bottom: 40px;
}

.section h2 {
    color: #3d4461;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    font-size: 1.8em;
}

.section h3 {
    color: #3d4461;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.section p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #333;
}

.section ul,
.section ol {
    line-height: 1.8;
    margin-bottom: 15px;
    padding-left: 30px;
}

.section li {
    margin-bottom: 8px;
}

.section a {
    color: #3d4461;
    text-decoration: none;
    border-bottom: 1px solid #3d4461;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.section a:hover {
    color: #2a3148;
    border-color: #2a3148;
}

/* Card Styles */
.card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 2px 8px rgba(61, 68, 97, 0.1);
}

.card h3 {
    color: #3d4461;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.card p {
    margin-bottom: 10px;
}

.card p:last-child {
    margin-bottom: 0;
}

/* Alert Boxes */
.alert {
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert strong {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

/* Text Utilities */
.text-muted {
    color: #6c757d;
    font-size: 0.9em;
}

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

/* Accordion (for FAQ sections) */
.accordion .card {
    margin-bottom: 15px;
    cursor: pointer;
}

.accordion .card h3 {
    font-size: 1.1em;
    color: #3d4461;
    margin-bottom: 8px;
}

.accordion .card:hover {
    box-shadow: 0 2px 8px rgba(61, 68, 97, 0.15);
}

/* Code Snippets */
code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #3d4461;
}

pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
}

pre code {
    background-color: transparent;
    padding: 0;
    color: #333;
}

/* Lists */
.section ul li strong,
.section ol li strong {
    color: #3d4461;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content {
        padding: 20px 15px;
    }

    .content h1 {
        font-size: 2em;
    }

    .section h2 {
        font-size: 1.5em;
    }

    .section h3 {
        font-size: 1.1em;
    }

    .section ul,
    .section ol {
        padding-left: 20px;
    }
}

/* Spacing Utilities */
.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Link Styles in Cards */
.card a {
    color: #3d4461;
    text-decoration: none;
    border-bottom: 1px solid #3d4461;
}

.card a:hover {
    color: #2a3148;
    border-color: #2a3148;
}

/* ============================================================================
   BETA MODE PILL
   Small inline badge rendered next to the logo in the header when the
   application is running in beta mode. Sits within the existing header height.
   ============================================================================ */

.beta-pill {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.90);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.6;
    vertical-align: middle;
    white-space: nowrap;
}
