/* ========================================
   PARTNER PAGE STYLES
   ======================================== */

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.benefit-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
}

.benefit-card:hover {
    border-color: var(--primary-coral);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.benefit-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-light);
    border-radius: 50%;
    color: var(--primary-coral);
}

.benefit-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.benefit-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Partner Tiers */
.tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tier-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    transition: all 0.2s ease;
}

.tier-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.tier-card.featured {
    border-color: var(--primary-coral);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.15);
}

.tier-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-coral);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tier-header {
    display: block;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.tier-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.tier-price {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--primary-coral);
}

.tier-description {
    margin: 0;
    padding: 0 0 1rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.tier-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.tier-features li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
}

.tier-features li:last-child {
    border-bottom: none;
}

.tier-features li::before {
    content: '✓';
    color: var(--primary-coral);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0.75rem;
}

.tier-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--primary-coral);
    background: transparent;
    color: var(--primary-coral);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.tier-btn.featured:hover {
    background: #e55a5a;
    border-color: #e55a5a;
}

/* ========================================
   MODAL STYLES
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-content.partner-modal {
    max-width: 700px;
}

.modal-content.api-dashboard {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--background-light);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--primary-coral);
    color: white;
}

.modal-body {
    padding: 2rem;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
}

.auth-tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.auth-tab-btn:hover {
    background: var(--background-light);
}

.auth-tab-btn.active {
    background: var(--primary-coral);
    color: white;
}

.auth-tab-content {
    display: none;
}

.auth-tab-content.active {
    display: block;
}

/* Form Styles */
.form-section {
    margin-bottom: 2rem;
}

.form-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

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

.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* Buttons */
.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--primary-coral);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #e55a5a;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* ========================================
   API DASHBOARD STYLES
   ======================================== */

.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-header span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-body {
    padding: 0;
}

.dashboard-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
    padding: 0 2rem;
    background: var(--background-light);
}

.tab-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

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

.tab-btn.active {
    color: var(--primary-coral);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-coral);
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

/* Credentials Section */
.credentials-section {
    margin-bottom: 2rem;
}

.credentials-section h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--background-light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background: #e8e8e8;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-label span {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-bar input,
.filter-bar select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.9rem;
}

.filter-bar input {
    flex: 1;
}

/* Keys List */
.keys-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.key-item,
.credential-key-item {
    background: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
}

.key-info h4,
.credential-key-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.key-meta,
.credential-key-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.key-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.key-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
}

.api-key {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: transparent;
    border: none;
    padding: 0.25rem;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: transform 0.2s ease;
}

.copy-btn:hover {
    transform: scale(1.1);
}

.key-actions,
.credential-key-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-small,
.btn-mini {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-regenerate,
.btn-edit {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-regenerate:hover,
.btn-edit:hover {
    background: #bbdefb;
}

.btn-revoke,
.btn-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-revoke:hover,
.btn-delete:hover {
    background: #ffcdd2;
}

.btn-permissions {
    background: #f3e5f5;
    color: #7b1fa2;
}

.btn-permissions:hover {
    background: #e1bee7;
}

/* Credential Key Header */
.credential-key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.credential-key-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.credential-key-status.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.credential-key-status.inactive {
    background: #ffebee;
    color: #c62828;
}

/* Permission Badges */
.credential-key-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.permission-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Keys Header */
.keys-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.keys-header h3 {
    margin: 0;
}

/* Docs Section */
.docs-section h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.docs-content h4 {
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.docs-content h4:first-child {
    margin-top: 0;
}

.docs-content p {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.docs-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

/* Loading & Error States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #c62828;
    background: #ffebee;
    border-radius: 8px;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    background: var(--background-light);
    border-radius: 8px;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .form-actions button {
        width: 100%;
    }

    .dashboard-tabs {
        padding: 0 1rem;
        overflow-x: auto;
    }

    .tab-btn {
        padding: 1rem;
        white-space: nowrap;
    }

    .tab-content {
        padding: 1.5rem;
    }

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

    .filter-bar {
        flex-direction: column;
    }

    .key-actions,
    .credential-key-actions {
        flex-wrap: wrap;
    }

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

    .docs-actions button {
        width: 100%;
    }

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

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

    .header-actions {
        gap: 0.5rem;
    }

    .header-actions .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}
