/* 🤝 PARTNER SYSTEM STYLES */

/* Partner Modal Styles */
.partner-modal {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.partner-form-container {
    padding: 0;
}

/* Partner Auth Tabs */
.partner-auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
    gap: 0;
}

.auth-tab-btn {
    flex: 1;
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: #6b6b6b;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab-btn:hover {
    color: #FF00FF;
    background: rgba(255, 0, 255, 0.05);
}

.auth-tab-btn.active {
    color: #FF00FF;
    border-bottom-color: #FF00FF;
    background: rgba(255, 0, 255, 0.1);
}

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

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

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.05) 0%, rgba(255, 255, 0, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 0, 255, 0.1);
}

.form-section h3 {
    color: #FF00FF;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #333333;
    font-family: 'Montserrat', sans-serif;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Cabin', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #FF00FF;
    box-shadow: 0 0 0 3px rgba(255, 0, 255, 0.1);
}

.form-group input:invalid {
    border-color: #ff4444;
}

.form-group input:valid {
    border-color: #44ff44;
}

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

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #FF00FF 0%, #FFFF00 100%);
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #FF00FF 20%, #FFFF00 80%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333333;
    border: 2px solid #e1e1e1;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #FF00FF;
}

/* API Management Modal Styles */
.api-management-modal {
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    overflow-y: auto;
}

.modal-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(135deg, #FF00FF 0%, #FFFF00 100%);
    color: white;
    margin: -24px -24px 1.5rem -24px;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-family: 'Cabin', sans-serif;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 1.5rem;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b6b6b;
}

.tab-btn.active {
    background: white;
    color: #FF00FF;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 0, 255, 0.05);
    color: #FF00FF;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.overview-card {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.overview-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #FF66FF 0%, #FFFF66 100%);
    padding: 1rem;
    border-bottom: 1px solid #e1e1e1;
}

.card-header h3 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #333333;
}

.card-content {
    padding: 1.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-family: 'Cabin', sans-serif;
    color: #6b6b6b;
    font-size: 14px;
}

.stat-value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #333333;
    font-size: 16px;
}

/* Real-time Stats */
.real-time-stats {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.05) 0%, rgba(255, 255, 0, 0.05) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.real-time-stats h3 {
    margin: 0 0 1rem 0;
    font-family: 'Montserrat', sans-serif;
    color: #FF00FF;
}

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

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 0, 255, 0.1);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #FF00FF;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 12px;
    color: #6b6b6b;
    font-family: 'Cabin', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.keys-header h3 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    color: #333333;
}

.keys-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    min-height: 200px;
}

.key-item {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.key-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.key-info h4 {
    margin: 0 0 0.5rem 0;
    font-family: 'Montserrat', sans-serif;
    color: #333333;
}

.key-meta {
    font-size: 12px;
    color: #6b6b6b;
    font-family: 'Cabin', sans-serif;
}

.key-display {
    margin-bottom: 0.5rem;
}

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

.api-key {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    color: #495057;
    flex: 1;
    min-width: 0;
    word-break: break-all;
}

.copy-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.copy-btn:active {
    transform: scale(0.95);
}

.no-data {
    text-align: center;
    color: #6b6b6b;
    padding: 1rem;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px dashed #dee2e6;
}

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

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-regenerate {
    background: #17a2b8;
    color: white;
}

.btn-revoke {
    background: #dc3545;
    color: white;
}

.btn-small:hover {
    transform: translateY(-1px);
}

/* Analytics Section */
.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.analytics-header h3 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    color: #333333;
}

.time-range-selector select {
    padding: 8px 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-family: 'Cabin', sans-serif;
}

.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e1e1e1;
}

.analytics-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 200px;
}

/* Documentation Section */
.docs-content {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
}

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

.docs-section h4 {
    margin: 0 0 1rem 0;
    font-family: 'Montserrat', sans-serif;
    color: #FF00FF;
    font-weight: 600;
}

.code-block {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
}

.code-block pre {
    color: #f8f8f2;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    white-space: pre-wrap;
}

.docs-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.docs-links a {
    text-decoration: none;
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b6b6b;
    font-family: 'Cabin', sans-serif;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e1e1e1;
    border-top: 2px solid #FF00FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

/* Success/Error States */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

/* Credentials Tab Styles */
.credentials-header {
    margin-bottom: 2rem;
}

.credentials-header h3 {
    color: #FF00FF;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.credentials-info {
    color: #6b6b6b;
    font-family: 'Cabin', sans-serif;
    font-size: 14px;
}

.credentials-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.create-key-panel,
.existing-keys-panel {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.create-key-panel h4,
.existing-keys-panel h4 {
    color: #333333;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key-creation-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 0, 255, 0.03);
    border: 1px solid rgba(255, 0, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.permission-item:hover {
    background: rgba(255, 0, 255, 0.06);
    border-color: rgba(255, 0, 255, 0.2);
}

.permission-item input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #FF00FF;
}

.permission-item label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.permission-name {
    font-weight: 500;
    color: #333333;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
}

.permission-desc {
    font-size: 11px;
    color: #6b6b6b;
    font-family: 'Cabin', sans-serif;
    line-height: 1.3;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

.table-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.table-filters input,
.table-filters select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    font-family: 'Cabin', sans-serif;
    font-size: 14px;
}

.credentials-keys-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.credential-key-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.credential-key-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.credential-key-name {
    font-weight: 600;
    color: #333333;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
}

.credential-key-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    font-family: 'Cabin', sans-serif;
}

.credential-key-status.active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.credential-key-status.inactive {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.credential-key-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.permission-badge {
    background: rgba(255, 0, 255, 0.1);
    color: #FF00FF;
    border: 1px solid rgba(255, 0, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    font-family: 'Cabin', sans-serif;
}

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

.btn-mini {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-family: 'Cabin', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #007bff;
    color: white;
}

.btn-edit:hover {
    background: #0056b3;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-permissions {
    background: #FF00FF;
    color: white;
}

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

/* Modal Responsive */
@media (max-width: 768px) {
    .partner-modal,
    .api-management-modal {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }

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

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

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

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

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

    .dashboard-tabs {
        flex-wrap: wrap;
    }

    .credentials-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    .table-filters {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tab-btn {
        min-width: 120px;
    }

    .key-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .key-actions {
        align-self: stretch;
        justify-content: flex-end;
    }

    .analytics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}