/* Settings Page Styles */

:root {
    --primary-color: #00a8ff;
    --primary-dark: #0088cc;
    --secondary-color: #ff6b6b;
    --accent-color: #ffd700;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
}

/* Settings Header */
.settings-header {
    position: relative;
    margin-bottom: 20px;
}

.header-cover {
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.header-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="gear" width="25" height="25" patternUnits="userSpaceOnUse"><circle cx="12.5" cy="12.5" r="2" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/><path d="M12.5 8L14 10L16 8L18 10L16 12L18 14L16 16L14 14L12.5 16L11 14L9 16L7 14L9 12L7 10L9 8L11 10L12.5 8Z" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23gear)"/></svg>');
    opacity: 0.6;
}

.cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.back-btn:active {
    transform: scale(0.9);
}

.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
    position: relative;
    z-index: 2;
}

/* Settings Content */
.settings-content {
    padding: 0 16px;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    letter-spacing: -0.3px;
    text-transform: uppercase;
    font-size: 0.85rem;
}

/* Setting Items */
.setting-item {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.setting-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 168, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.setting-item:active::before {
    transform: translateX(100%);
}

.setting-item:active {
    transform: scale(0.98);
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(0, 168, 255, 0.2);
}

.setting-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 168, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.setting-content {
    flex: 1;
    min-width: 0;
}

.setting-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.setting-description {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.3;
}

.setting-arrow {
    color: var(--text-light);
    flex-shrink: 0;
}

/* Toggle Switches */
.setting-toggle {
    flex-shrink: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    background: #e0e0e0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked + .toggle-switch {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked + .toggle-switch::before {
    transform: translateX(20px);
    box-shadow: 0 2px 8px rgba(0, 168, 255, 0.4);
}

/* Sign Out Section */
.sign-out-section {
    margin: 40px 0 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.sign-out-btn {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 12px;
    color: #c62828;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.sign-out-btn:active {
    transform: scale(0.98);
    background: rgba(255, 59, 48, 0.15);
    border-color: rgba(255, 59, 48, 0.5);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: linear-gradient(145deg, #1e1e1e 0%, #2a2a2a 100%);
    border: 1px solid #333;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.3px;
}

.close-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.15);
}

.modal-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    color: #fff;
    line-height: 1.5;
}

.modal-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
}

.modal-content h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    margin: 16px 0 8px;
}

.modal-content p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 12px;
}

.modal-content ul {
    margin: 8px 0 12px 16px;
    font-size: 0.85rem;
}

.modal-content li {
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.8);
}

.modal-actions {
    padding: 16px 20px 20px;
    border-top: 1px solid #333;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.btn-danger:active {
    transform: scale(0.96);
    background: rgba(255, 59, 48, 0.3);
}

/* Special Content Styles */
.subscription-info ul,
.legal-content ul {
    list-style: none;
    padding: 0;
}

.subscription-info li {
    padding: 4px 0;
}

.subscription-details {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.subscription-details h4 {
    margin: 0 0 12px;
    color: #667eea;
}

.status-active {
    color: #00ff88;
    font-weight: 600;
}

.subscription-benefits {
    margin-bottom: 20px;
}

.subscription-actions {
    margin-bottom: 16px;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 12px 0;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(102, 126, 234, 0.4);
    color: #667eea;
}

.btn-outline:active {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.btn-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.btn-warning:active {
    background: rgba(255, 193, 7, 0.3);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.billing-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    font-size: 0.8rem;
}

.plan-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

.current-plan,
.new-plan {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.new-plan {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
    margin: 4px 0;
}

.savings {
    color: #00ff88;
    font-weight: 600;
    font-size: 0.8rem;
    margin: 4px 0 0;
}

.pause-info,
.cancel-info {
    text-align: left;
}

.cancel-warning {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.retention-offer {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.retention-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.cancel-reason-select {
    width: 100%;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.85rem;
    margin-top: 8px;
}

.cancel-reason-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.success-content,
.cancellation-content {
    text-align: center;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.loading-content .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.rate-app-content {
    text-align: center;
}

.star-rating {
    font-size: 1.5rem;
    margin: 16px 0;
}

.update-content {
    text-align: center;
}

.deletion-content ul {
    text-align: left;
    margin: 16px 0;
}

.deletion-content li {
    padding: 4px 0;
    font-weight: 500;
}

/* Settings page specific navigation state */
.nav-item[data-page="settings"] {
    background: rgba(102, 126, 234, 0.1);
}

.nav-item[data-page="settings"] .nav-icon {
    color: #667eea;
}

.nav-item[data-page="settings"] .nav-label {
    color: #667eea;
}

/* Accessibility improvements */
.setting-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.toggle-switch:focus-within {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Loading states */
.setting-description.loading {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 16px;
    width: 120px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (min-width: 375px) {
    .header-cover {
        height: 140px;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .setting-item {
        padding: 18px;
    }
    
    .setting-icon {
        width: 44px;
        height: 44px;
    }
}

@media (min-width: 768px) {
    .settings-content {
        max-width: 400px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    .settings-header {
        max-width: 400px;
        margin: 0 auto 20px;
    }
    
    .modal {
        max-width: 500px;
    }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    .setting-item {
        background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .modal {
        background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .setting-item {
        border: 2px solid #666;
    }
    
    .toggle-switch {
        border: 2px solid #666;
    }
    
    .modal {
        border: 2px solid #666;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .setting-item::before,
    .cover-overlay,
    .modal {
        animation: none;
    }
    
    .setting-item,
    .toggle-switch::before,
    .btn {
        transition: none;
    }
}