/* Settings Pages Styles */

/* Extends admin.css */

/* ===========================
   Settings Container
   =========================== */
.settings-container {
    max-width: 1000px;
    margin: 0 auto;
}

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

.settings-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.settings-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===========================
   Settings Card
   =========================== */
.settings-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.settings-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* ===========================
   2FA Setup
   =========================== */
.twofa-setup {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    border: 2px dashed var(--border-color);
}

.qr-code {
    width: 256px;
    height: 256px;
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.qr-code canvas {
    display: block;
    margin: 0 auto;
}

.secret-display {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    text-align: center;
}

.secret-code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 1.125rem;
    color: var(--primary-color);
    letter-spacing: 0.1em;
    font-weight: 600;
    word-break: break-all;
}

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

.code-input {
    width: 100%;
    max-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5em;
    font-family: 'Monaco', 'Courier New', monospace;
    font-weight: 600;
}

.code-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.instructions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.instruction-step {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.step-number {
    min-width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.step-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.warning-box {
    padding: 1rem;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.warning-icon {
    font-size: 1.25rem;
}

.warning-text {
    flex: 1;
    font-size: 0.875rem;
    color: #92400e;
}

.warning-text strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* ===========================
   Activity Logs Table
   =========================== */
.logs-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.logs-table-container {
    overflow-x: auto;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table thead {
    background: var(--bg-light);
}

.logs-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.logs-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.logs-table tr:hover {
    background: var(--bg-light);
}

.action-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.action-badge.login {
    background: #d1fae5;
    color: #065f46;
}

.action-badge.logout {
    background: #fee2e2;
    color: #991b1b;
}

.action-badge.password_reset {
    background: #fef3c7;
    color: #92400e;
}

.action-badge.create_article,
.action-badge.update_article {
    background: #dbeafe;
    color: #1e40af;
}

.action-badge.delete_article {
    background: #fee2e2;
    color: #991b1b;
}

.timestamp {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-primary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-family: inherit;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===========================
   Account Settings Forms
   =========================== */
.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

/* ===========================
   Empty States
   =========================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
}

/* ===========================
   Success/Error Messages
   =========================== */
.message-box {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.message-box.success {
    background: #d1fae5;
    border: 1px solid #86efac;
    color: #065f46;
}

.message-box.error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.message-box.info {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
    .settings-card {
        padding: 1.5rem;
    }

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

    .logs-table {
        font-size: 0.8125rem;
    }

    .logs-table th,
    .logs-table td {
        padding: 0.5rem;
    }

    .qr-code {
        width: 200px;
        height: 200px;
    }
}
