/* ===== API Keys Page ===== */
.apikeys-page {
    padding: 120px 0 80px;
    min-height: 100vh;
}

.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-header h1 {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Generate Card */
.apikeys-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.apikeys-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.apikeys-stat-card:hover {
    border-color: var(--border-hover);
}

.apikeys-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
    font-family: var(--font-mono);
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.apikeys-stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.apikeys-generate-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.apikeys-generate-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--emerald), var(--gold));
}

.apikeys-generate-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.apikeys-generate-icon {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 168, 83, 0.08);
    border: 1px solid rgba(212, 168, 83, 0.15);
    border-radius: 14px;
}

.apikeys-generate-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

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

.apikeys-generate-form {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.apikeys-generate-form input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
    transition: all 0.3s;
}

.apikeys-generate-form input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--glow-gold);
}

.apikeys-generate-form input::placeholder {
    color: var(--text-muted);
}

.apikeys-generate-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 160px;
}

.apikeys-generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px var(--glow-gold);
}

.apikeys-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

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

/* Generated Key Result */
.apikeys-result {
    margin-top: 24px;
    padding: 20px;
    background: rgba(52, 211, 153, 0.04);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: var(--radius-sm);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.apikeys-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.result-badge {
    padding: 4px 12px;
    background: rgba(52, 211, 153, 0.15);
    color: var(--emerald);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-warning {
    font-size: 0.78rem;
    color: var(--gold);
    font-weight: 500;
}

.apikeys-result-key {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(52, 211, 153, 0.15);
    border-radius: 10px;
}

.apikeys-result-key code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--emerald);
    word-break: break-all;
    user-select: all;
}

.copy-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.copy-btn:hover {
    border-color: var(--gold);
    background: rgba(212, 168, 83, 0.05);
    transform: scale(1.05);
}

/* Usage Section */
.apikeys-usage {
    margin-bottom: 40px;
}

.apikeys-usage h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.usage-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.usage-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.usage-step {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--gold);
    margin: 0 auto 12px;
}

.usage-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.usage-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.usage-card code {
    font-family: var(--font-mono);
    background: rgba(212, 168, 83, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--gold);
}

.usage-example {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.usage-example h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.usage-example pre {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
}

.usage-example code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--emerald);
    line-height: 1.7;
}

/* Rate Limits */
.apikeys-limits {
    margin-bottom: 40px;
}

.apikeys-limits h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.limits-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.limits-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    padding: 16px 24px;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
}

.limits-row:last-child {
    border-bottom: none;
}

.limits-header {
    background: rgba(212, 168, 83, 0.04);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.limits-row span {
    font-size: 0.88rem;
}

.tier-badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge.free {
    background: rgba(52, 211, 153, 0.1);
    color: var(--emerald);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.tier-badge.pro {
    background: rgba(212, 168, 83, 0.1);
    color: var(--gold);
    border: 1px solid rgba(212, 168, 83, 0.2);
}

/* Keys List */
.apikeys-list h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.apikeys-grid {
    display: grid;
    gap: 12px;
}

.apikeys-empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.apikeys-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.apikeys-empty p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Key Card */
.key-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.key-card:hover {
    border-color: var(--border-hover);
}

.key-card-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 168, 83, 0.08);
    border-radius: 10px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.key-card-info {
    flex: 1;
    min-width: 0;
}

.key-card-name {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.key-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.key-card-tier {
    flex-shrink: 0;
}

.key-card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .apikeys-stats {
        grid-template-columns: 1fr;
    }

    .apikeys-generate-form {
        flex-direction: column;
    }

    .apikeys-generate-btn {
        width: 100%;
    }

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

    .limits-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .limits-header {
        display: none;
    }

    .key-card {
        flex-wrap: wrap;
    }

    .apikeys-generate-card {
        padding: 24px;
    }

    .apikeys-result-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
