/* settings.css - Premium Styles for settings and user directory */

.settings-shell {
    padding: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    font-family: "Plus Jakarta Sans", sans-serif;
    color: #1e293b;
    animation: fadeIn 0.4s ease-out;
}

.settings-header {
    margin-bottom: 2rem;
}

.settings-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.settings-subtitle {
    color: #64748b;
    font-size: 1.05rem;
}

.settings-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.04), 0 4px 12px -2px rgba(0, 0, 0, 0.01);
}

/* Sidebar Tab Nav */
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-right: 1px solid #e2e8f0;
    padding-right: 1.5rem;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: #475569;
    font-size: 0.98rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab:hover {
    background: rgba(99, 102, 241, 0.06);
    color: #6366f1;
}

.nav-tab.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.09) 0%, rgba(124, 58, 237, 0.09) 100%);
    color: #4f46e5;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.tab-icon {
    font-size: 1.2rem;
}

/* Content Area */
.settings-content {
    min-height: 500px;
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.section-desc {
    color: #64748b;
    font-size: 0.92rem;
    margin-bottom: 1.75rem;
}

.section-divider {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 2.25rem 0;
}

/* Form Styles */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.form-row .form-group {
    flex: 1;
    min-width: 250px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.form-control,
.form-select {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.form-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

.status-display-box {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: flex-start;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #475569;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #334155;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-close-custom {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: currentColor;
    opacity: 0.6;
    padding: 0 8px;
    line-height: 1;
}

.btn-close-custom:hover {
    opacity: 1;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid transparent;
}

.btn-outline-warning {
    border-color: #d97706;
    color: #d97706;
    background: transparent;
}

.btn-outline-warning:hover {
    background: #d97706;
    color: #ffffff;
}

.btn-outline-primary {
    border-color: #2563eb;
    color: #2563eb;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #2563eb;
    color: #ffffff;
}

.btn-outline-danger {
    border-color: #ef4444;
    color: #ef4444;
    background: transparent;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Switch */
.form-switch {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-switch .form-check-input {
    width: 44px;
    height: 24px;
    background-color: #cbd5e1;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -4 16 16'%3e%3cpath fill='%23fff' d='M5 4a4 4 0 1 1 8 0 4 4 0 0 1-8 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left center;
    border-radius: 12px;
    border: none;
    transition: background-position 0.2s ease-in-out, background-color 0.2s ease-in-out;
    cursor: pointer;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.form-switch .form-check-input:checked {
    background-color: #6366f1;
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -4 16 16'%3e%3cpath fill='%23fff' d='M3 4a4 4 0 1 1 8 0 4 4 0 0 1-8 0z'/%3e%3c/svg%3e");
}

.form-check-label {
    cursor: pointer;
    font-size: 0.95rem;
    color: #0f172a;
}

/* User Directory list */
.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.search-bar {
    margin-bottom: 1.5rem;
}

.search-input {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    background: #ffffff;
}

.users-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
}

.users-table tr:last-child td {
    border-bottom: none;
}

.user-name {
    font-weight: 600;
    color: #0f172a;
    display: inline-block;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 20px;
    line-height: 1;
}

.bg-secondary-pill {
    background: #e2e8f0;
    color: #475569;
    margin-left: 6px;
    font-size: 0.7rem;
    padding: 3px 6px;
}

.bg-success-light {
    background: #d1fae5;
    color: #065f46;
}

.bg-warning-light {
    background: #fef3c7;
    color: #92400e;
}

.bg-danger-light {
    background: #fee2e2;
    color: #991b1b;
}

.bg-muted {
    background: #f1f5f9;
    color: #64748b;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.75rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* Modals & Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    z-index: 1010;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.settings-modal.modal-wide {
    max-width: 700px;
}

.settings-modal.modal-danger {
    border-top: 5px solid #ef4444;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-tab-header {
    border-bottom: 2px solid #6366f1;
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.modal-tab-header h4 {
    font-size: 1.02rem;
    font-weight: 700;
    color: #6366f1;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-footer .btn {
    align-self: center;
}

.text-danger-custom {
    color: #dc2626;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: translate(-50%, -48%) scale(0.96); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.25s ease-out;
}

/* Responsive Grid and Spacing */
@media (max-width: 992px) {
    .settings-container {
        grid-template-columns: 1fr;
    }
    .settings-nav {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-right: 0;
        padding-bottom: 1rem;
        overflow-x: auto;
        white-space: nowrap;
    }
    .nav-tab {
        width: auto;
        padding: 10px 16px;
    }
}

@media (max-width: 640px) {
    .settings-shell {
        padding: 1.25rem 0.75rem;
    }
    .settings-container {
        padding: 1rem;
        border-radius: 16px;
    }
    .settings-header h1 {
        font-size: 1.75rem;
    }
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    .form-row .form-group {
        width: 100%;
    }
    .modal-body {
        padding: 16px;
    }
    .modal-footer {
        padding: 12px 16px;
    }
    .btn {
        width: 100%;
    }
    .settings-modal {
        width: 95%;
    }
}
