/* Riverforge - Modern UI Styles */

:root {
    --primary-color: #F59E0B;
    --primary-hover: #D97706;
    --secondary-color: #22D3EE;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-dark: #0B1121;
    --bg-card: #142038;
    --bg-light: #1E293B;
    --text-primary: #E2E8F0;
    --text-secondary: #94A3B8;
    --border-color: #334155;
    --headline-color: #22D3EE;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

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

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--headline-color);
}

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

.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--headline-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-dark);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.btn-full {
    width: 100%;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid #10b981;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--bg-dark);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card .label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.api-key-box {
    background: var(--bg-dark);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.api-key-box code {
    flex: 1;
    color: var(--text-primary);
}

.copy-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: var(--bg-dark);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
    font-weight: 600;
}

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

.usage-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.usage-table th {
    background: var(--bg-light);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.usage-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.usage-table tr:hover {
    background: var(--bg-light);
}

.nav-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: var(--bg-card);
    color: var(--secondary-color);
}

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

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

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

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

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

    .header img {
        height: 32px;
    }

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

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .nav-links a {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .card {
        padding: 1.5rem;
    }

    .card h2 {
        font-size: 1.25rem;
    }

    .form-group input {
        padding: 0.875rem;
    }

    .btn {
        padding: 0.875rem 1.25rem;
    }

    .api-key-box {
        flex-direction: column;
        gap: 0.75rem;
    }

    .api-key-box code {
        font-size: 0.8rem;
        word-break: break-all;
    }

    .copy-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header p {
        font-size: 0.9rem;
    }

    .card {
        padding: 1.25rem;
    }

    .nav-links a {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}
