﻿/* Settings Styles - Modern Design */

/* Alert Banner */
.alert-banner {
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-banner.danger {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.alert-banner.warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.alert-banner.info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.alert-banner i {
    font-size: 24px;
}

.alert-banner > div {
    flex: 1;
}

.alert-banner strong {
    display: block;
    margin-bottom: 4px;
}

/* Content Header */
.content-header {
    background: white;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    margin: -32px -32px 32px -32px;
}

.content-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.content-header p {
    color: var(--text-secondary);
    margin: 4px 0 0 0;
    font-size: 14px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0 0 24px 0;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--color-primary-50);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn i {
    margin-right: 8px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

/* Card Header */
.card-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.card-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Profile Section */
.profile-section {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.profile-avatar-large {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-800) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    box-shadow: 0 8px 24px var(--color-primary-200);
    transition: all 0.3s ease;
}

.profile-avatar-large:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px var(--color-primary-300);
}

.profile-form {
    flex: 1;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 14px;
}

.form-group .form-control,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: var(--white, #ffffff);
    color: var(--text-primary, #0f172a);
}

.form-group .form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--color-primary-100, #dbeafe);
    background-color: var(--white, #ffffff);
}

.form-group .form-control::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary, #94a3b8);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Current Plan */
.current-plan {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: center;
}

.plan-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-800) 100%);
    color: white;
    border-radius: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    font-size: 14px;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px var(--color-primary-200);
}

.plan-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.plan-price small {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.plan-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-features div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
    font-size: 14px;
}

.plan-features i {
    color: #28a745;
    font-size: 16px;
}

.plan-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* API Key Section */
.api-key-section {
    max-width: 700px;
}

.input-group {
    display: flex;
    gap: 12px;
}

.input-group .form-control {
    flex: 1;
}

/* Team List */
.team-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 14px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.team-member:hover {
    background: white;
    border-color: var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.member-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-800) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 20px;
    box-shadow: 0 4px 12px var(--color-primary-200);
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 15px;
}

.member-email {
    font-size: 13px;
    color: var(--text-secondary);
}

.member-role {
    display: inline-block;
    padding: 6px 14px;
    background: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.member-actions {
    display: flex;
    gap: 8px;
}

/* Integrations Grid */
.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.integration-card {
    padding: 24px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.integration-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-6px);
}

.integration-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.integration-card:hover .integration-icon {
    background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-800) 100%);
    color: white;
    box-shadow: 0 4px 16px var(--color-primary-200);
}

.integration-info h4 {
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.integration-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 12px;
}

.input-group .form-control {
    flex: 1;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    margin-top: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--bg-secondary);
}

table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
}

table tbody tr:hover {
    background: var(--bg-secondary);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #dee2e6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-800) 100%);
    box-shadow: 0 2px 8px var(--color-primary-200);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Alert Box */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert i {
    font-size: 18px;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state-small {
    text-align: center;
    padding: 32px 16px;
    color: #6c757d;
}

.empty-state-small i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-small p {
    margin: 0;
    font-size: 14px;
}

/* Text Helpers */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.form-text {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 992px) {
    .integrations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-section {
        grid-template-columns: 160px 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .content-header {
        padding: 16px 20px;
        margin: -20px -16px 20px -16px;
    }
    
    .content-header h1 {
        font-size: 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    .profile-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .profile-avatar-large {
        width: 120px;
        height: 120px;
        font-size: 42px;
    }
    
    .current-plan {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .integrations-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        padding-bottom: 2px;
    }
    
    .tab-btn {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .tab-btn i {
        margin-right: 6px;
    }
    
    .team-member {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .member-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .plan-actions {
        width: 100%;
    }
    
    .plan-actions .btn {
        width: 100%;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 16px;
        border-radius: 12px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .profile-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 36px;
    }
    
    .plan-price {
        font-size: 28px;
    }
    
    .member-avatar {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
    
    .integration-card {
        padding: 16px;
    }
    
    .integration-icon {
        width: 52px;
        height: 52px;
        font-size: 24px;
    }
}
