/* LifeDB Admin Styles */
/* Styles for Settings and Diagnostics pages */

/* Settings Page Styles */
.settings-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.settings-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.theme-option {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card-bg);
}

.theme-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.theme-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.theme-preview {
    width: 100%;
    height: 60px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
    position: relative;
}

.theme-header {
    height: 40px;
    width: 100%;
}

.theme-colors {
    height: 20px;
    display: flex;
}

.theme-colors span {
    flex: 1;
    height: 100%;
}

/* Theme header gradients */
.theme-header-steel { background: linear-gradient(135deg, #475569, #64748B); }
.theme-header-ocean { background: linear-gradient(135deg, #0EA5E9, #38BDF8); }
.theme-header-forest { background: linear-gradient(135deg, #059669, #10B981); }
.theme-header-cherry { background: linear-gradient(135deg, #EC4899, #F472B6); }
.theme-header-rose { background: linear-gradient(135deg, #E11D48, #FB7185); }
.theme-header-corduroy { background: linear-gradient(135deg, #A16207, #CA8A04); }
.theme-header-golden { background: linear-gradient(135deg, #D97706, #F59E0B); }
.theme-header-sunset { background: linear-gradient(135deg, #EA580C, #FB923C); }

/* Theme color spans */
.theme-color-steel-1 { background: #475569; }
.theme-color-steel-2 { background: #0F766E; }
.theme-color-steel-3 { background: #0EA5E9; }

.theme-color-ocean-1 { background: #0EA5E9; }
.theme-color-ocean-2 { background: #06B6D4; }
.theme-color-ocean-3 { background: #10B981; }

.theme-color-forest-1 { background: #059669; }
.theme-color-forest-2 { background: #0D9488; }
.theme-color-forest-3 { background: #84CC16; }

.theme-color-cherry-1 { background: #EC4899; }
.theme-color-cherry-2 { background: #F97316; }
.theme-color-cherry-3 { background: #84CC16; }

.theme-color-rose-1 { background: #E11D48; }
.theme-color-rose-2 { background: #EC4899; }
.theme-color-rose-3 { background: #F97316; }

.theme-color-corduroy-1 { background: #A16207; }
.theme-color-corduroy-2 { background: #92400E; }
.theme-color-corduroy-3 { background: #059669; }

.theme-color-golden-1 { background: #D97706; }
.theme-color-golden-2 { background: #EA580C; }
.theme-color-golden-3 { background: #EAB308; }

.theme-color-sunset-1 { background: #EA580C; }
.theme-color-sunset-2 { background: #DC2626; }
.theme-color-sunset-3 { background: #F59E0B; }

.theme-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.night-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.exist-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.sync-status.success {
    background: #D1FAE5;
    color: #065F46;
}

.sync-status.error {
    background: #FEE2E2;
    color: #991B1B;
}

.sync-status.pending {
    background: #FEF3C7;
    color: #92400E;
}

/* Diagnostics Page Styles */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-indicator.success {
    background-color: #22C55E;
}

.status-indicator.warning {
    background-color: #F59E0B;
}

.status-indicator.error {
    background-color: #EF4444;
}

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

.diagnostic-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.diagnostic-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diagnostic-content {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.log-viewer {
    background: #1a1a1a;
    color: #f0f0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    padding: 1rem;
    border-radius: 0.25rem;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    border: 1px solid var(--border-color);
}

.log-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.log-controls select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: var(--card-bg);
    color: var(--text-primary);
}

.service-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.service-name {
    font-weight: 500;
    color: var(--text-primary);
}

.service-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.api-test-results {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 1rem;
    margin-top: 0.5rem;
}

.test-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.test-result:last-child {
    border-bottom: none;
}

.test-name {
    font-weight: 500;
    color: var(--text-primary);
}

.test-status {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.test-status.pass {
    background: #D1FAE5;
    color: #065F46;
}

.test-status.fail {
    background: #FEE2E2;
    color: #991B1B;
}

/* Auth Forms */
.auth-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

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

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

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

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-link {
    text-align: center;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.auth-link:hover {
    text-decoration: underline;
}

.btn-auth {
    width: 100%;
    margin-bottom: 1rem;
}

/* Form animations */
.auth-container {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Password validation styles */
.form-input[type="password"]:focus {
    border-color: var(--primary-color);
}

.form-input[type="password"]:invalid {
    border-color: var(--warning-color);
}

.form-input[type="password"]:valid {
    border-color: var(--success-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theme-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .diagnostics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .log-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .service-status {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .test-result {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .auth-container {
        margin: 2rem 1rem;
        padding: 1.5rem;
    }
}