/* =============================================================================
   IberAPIs Portal - Estilos
   ============================================================================= */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #0f172a;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;

    --border: #e2e8f0;
    --border-dark: #cbd5e1;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: var(--bg-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, pre {
    font-family: 'JetBrains Mono', monospace;
}

code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

pre {
    background: var(--bg-dark);
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* =============================================================================
   Navbar
   ============================================================================= */

.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.nav-logo:hover {
    text-decoration: none;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--primary);
    text-decoration: none;
}

.nav-link-api {
    background: var(--primary);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.nav-link-api:hover {
    background: var(--primary-dark);
}

/* =============================================================================
   Main Content
   ============================================================================= */

.main-content {
    min-height: calc(100vh - 200px);
}

/* =============================================================================
   Buttons
   ============================================================================= */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    text-align: center;
}

.btn:hover {
    text-decoration: none;
}

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

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

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

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

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

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* =============================================================================
   Hero Section
   ============================================================================= */

.hero {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e3a5f 100%);
    color: white;
    padding: 4rem 1.5rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #94a3b8;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* =============================================================================
   Features Section
   ============================================================================= */

.features {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.feature-link {
    font-weight: 500;
}

/* =============================================================================
   Quickstart Section
   ============================================================================= */

.quickstart {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.quickstart h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.quickstart-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.step {
    text-align: center;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 auto 1rem;
}

.code-example {
    margin-bottom: 1.5rem;
}

.code-example h4 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* =============================================================================
   CTA Section
   ============================================================================= */

.cta {
    background: var(--bg-dark);
    color: white;
    padding: 4rem 1.5rem;
    text-align: center;
}

.cta h2 {
    margin-bottom: 0.5rem;
}

.cta p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

/* =============================================================================
   Pricing
   ============================================================================= */

.pricing-hero {
    text-align: center;
    padding: 4rem 1.5rem 2rem;
}

.pricing-hero h1 {
    margin-bottom: 0.5rem;
}

.pricing-hero p {
    color: var(--text-secondary);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.pricing-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
}

.pricing-card-highlighted {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.pricing-price {
    margin-bottom: 0.5rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
}

.price-period {
    color: var(--text-secondary);
}

.pricing-requests {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.pricing-modules, .pricing-features {
    margin-bottom: 1.5rem;
}

.pricing-modules h4, .pricing-features h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.pricing-modules ul, .pricing-features ul {
    list-style: none;
}

.pricing-modules li, .pricing-features li {
    padding: 0.25rem 0;
}

.pricing-faq {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.pricing-faq h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.faq-item p {
    color: var(--text-secondary);
}

.pricing-cta {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--bg-secondary);
}

/* =============================================================================
   Keys Management
   ============================================================================= */

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

.keys-container h1 {
    margin-bottom: 2rem;
}

.keys-search, .keys-create, .keys-usage {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.keys-search h2, .keys-create h2, .keys-usage h2, .keys-list h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.search-form, .create-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

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

.keys-count {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.keys-grid {
    display: grid;
    gap: 1rem;
}

.key-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.key-card-inactive {
    opacity: 0.7;
}

.key-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.key-plan {
    font-weight: 600;
    font-size: 0.875rem;
}

.plan-free { color: var(--text-secondary); }
.plan-startup { color: var(--primary); }
.plan-business { color: var(--success); }
.plan-enterprise { color: var(--warning); }

.key-status {
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active { color: var(--success); }
.status-inactive { color: var(--danger); }

.key-value {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.key-value code {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.btn-copy {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.key-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.detail-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 500;
}

.key-actions {
    display: flex;
    gap: 0.5rem;
}

.inline-form {
    display: inline;
}

/* =============================================================================
   Dashboard
   ============================================================================= */

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

.dashboard-search {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-stats {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-secondary);
}

.dashboard-section {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-section h2 {
    margin-bottom: 1rem;
}

.plan-distribution {
    display: flex;
    gap: 1rem;
}

.plan-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-secondary);
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

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

.dashboard-table th {
    font-weight: 500;
    color: var(--text-secondary);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.status-active {
    background: #dcfce7;
    color: var(--success);
}

.status-badge.status-inactive {
    background: #fee2e2;
    color: var(--danger);
}

.dashboard-actions h2 {
    margin-bottom: 1rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-card {
    display: block;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: box-shadow 0.2s;
}

.action-card:hover {
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.action-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dashboard-empty {
    text-align: center;
    padding: 3rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* =============================================================================
   Docs
   ============================================================================= */

.docs-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.docs-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.docs-sidebar h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.docs-sidebar h3:first-child {
    margin-top: 0;
}

.docs-nav {
    display: flex;
    flex-direction: column;
}

.docs-nav-link {
    padding: 0.5rem 0;
    color: var(--text-primary);
    border-left: 2px solid transparent;
    padding-left: 1rem;
}

.docs-nav-link:hover {
    color: var(--primary);
    border-left-color: var(--primary);
    text-decoration: none;
}

.docs-content h1 {
    margin-bottom: 1rem;
}

.docs-intro {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.docs-section {
    margin-bottom: 3rem;
}

.docs-section h2 {
    padding-top: 1rem;
    margin-bottom: 1rem;
}

.docs-section h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.docs-section h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.docs-note {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
    padding: 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1rem 0;
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

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

.docs-table th {
    background: var(--bg-secondary);
    font-weight: 500;
}

.method-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.method-get { background: #dcfce7; color: #166534; }
.method-post { background: #dbeafe; color: #1e40af; }
.method-put { background: #fef3c7; color: #92400e; }
.method-delete { background: #fee2e2; color: #991b1b; }

.module-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.docs-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3rem 0;
}

.docs-footer {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

/* =============================================================================
   Alerts
   ============================================================================= */

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* =============================================================================
   Footer
   ============================================================================= */

.footer {
    background: var(--bg-dark);
    color: #94a3b8;
    padding: 3rem 1.5rem 1.5rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #94a3b8;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid #334155;
    text-align: center;
    font-size: 0.875rem;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

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

    .hero-actions {
        flex-direction: column;
    }

    .quickstart-steps {
        grid-template-columns: 1fr;
    }

    .search-form, .create-form {
        flex-direction: column;
    }

    .key-details {
        grid-template-columns: 1fr;
    }

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

    .docs-container {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
    }
}
