/* Security Page Styles */

/* Security Overview */
.security-overview {
    padding: 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.security-score {
    text-align: center;
    margin-bottom: 20px;
}

.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border: 3px solid rgba(168, 85, 247, 0.2);
}

.score-progress {
    position: absolute;
    top: -3px;
    left: -3px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#a855f7 0deg, #a855f7 331.2deg, transparent 331.2deg); /* 92% = 331.2deg */
    mask: radial-gradient(circle, transparent 45px, black 45px);
    -webkit-mask: radial-gradient(circle, transparent 45px, black 45px);
}

.score-text {
    text-align: center;
    z-index: 1;
}

.score-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.score-label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.security-status {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-item.status-good {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.status-icon {
    font-size: 20px;
    line-height: 1;
}

.status-text {
    flex: 1;
}

.status-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.status-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.recommendations {
    margin-top: 8px;
}

.rec-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.rec-icon {
    font-size: 16px;
}

/* Security Sections */
.security-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.security-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.security-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.item-icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.item-content {
    flex: 1;
}

.item-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.item-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.item-action {
    display: flex;
    align-items: center;
}

/* Button Styles */
.btn-secondary {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-text {
    background: none;
    border: none;
    color: var(--brand-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-text:hover {
    background: rgba(168, 85, 247, 0.1);
    transform: translateY(-1px);
}

.btn-danger {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.btn-danger-outline {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-1px);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

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

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 1px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

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

/* Status Badge */
.status-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Modal Styles */
.security-modal {
    max-width: 480px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-content {
    padding: 20px;
}

.setup-steps {
    margin-bottom: 24px;
}

.step {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--brand-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 16px;
}

.step-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.step-content p {
    color: var(--text-muted);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.app-links {
    display: flex;
    gap: 12px;
}

.app-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.app-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.app-link img {
    width: 16px;
    height: 16px;
}

.qr-code {
    text-align: center;
    margin: 20px 0;
}

.qr-code img {
    width: 160px;
    height: 160px;
    border-radius: 8px;
    background: white;
    padding: 16px;
}

.manual-entry {
    text-align: center;
    margin-top: 20px;
}

.manual-entry p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.manual-entry code {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.code-input {
    text-align: center;
    margin: 20px 0;
}

.code-input input {
    width: 120px;
    padding: 16px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    letter-spacing: 4px;
    transition: all 0.2s ease;
}

.code-input input:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.help-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-actions .btn-secondary,
.modal-actions .btn-primary {
    padding: 12px 24px;
    font-size: 16px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(168, 85, 247, 0.2);
    border-top: 3px solid var(--brand-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-overlay p {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 480px) {
    .security-overview {
        padding: 16px;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-progress {
        width: 100px;
        height: 100px;
    }
    
    .score-number {
        font-size: 28px;
    }
    
    .security-section {
        padding: 16px;
    }
    
    .security-item {
        padding: 12px 0;
    }
    
    .item-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .app-links {
        flex-direction: column;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .modal-actions .btn-secondary,
    .modal-actions .btn-primary {
        width: 100%;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .score-progress,
    .toggle-slider,
    .toggle-slider:before,
    .loading-spinner,
    .step {
        animation: none;
        transition: none;
    }
}

@media (forced-colors: active) {
    .security-section,
    .status-item,
    .rec-item {
        border: 1px solid ButtonText;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        forced-color-adjust: none;
    }
}

/* Focus Styles */
.btn-secondary:focus-visible,
.btn-text:focus-visible,
.btn-danger:focus-visible,
.btn-danger-outline:focus-visible,
.toggle-switch:focus-visible,
.app-link:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}

.modal-close:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}