/**
 * Profile Page v2 - Modern Styles
 * Matches app theme and saved-questions design
 */

/* ============================================================================
   MAIN CONTAINER
   ============================================================================ */

.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.profile-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.profile-card-header {
    padding: 1rem 1.5rem;
    font-size: 1.3rem;
    color: #368BC1;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-card-header .menu-icon {
    width: 22px;
    height: 22px;
    color: #368BC1;
    flex-shrink: 0;
}

.profile-card-body {
    padding: 1.5rem;
}

/* ============================================================================
   INFO DISPLAY (Read-only fields)
   ============================================================================ */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    color: #212529;
    font-weight: 500;
}

.info-value.muted {
    color: #6c757d;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
}

.badge--success {
    background: #d4edda;
    color: #155724;
}

.badge--danger {
    background: #f8d7da;
    color: #721c24;
}

.badge--warning {
    background: #fff3cd;
    color: #856404;
}

.badge--info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge--monthly {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
}

.badge--secondary {
    background: #e9ecef;
    color: #6c757d;
}

/* Free account badge (for users who joined with 100% discount) */
.free-account-badge-profile {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.3);
}

/* ============================================================================
   FORMS (clean minimal style)
   ============================================================================ */

.profile-container .form-group,
.modal .form-group {
    margin-bottom: 1.5rem;
    background: none;
    border: none;
    padding: 0;
    display: block;
    font-size: inherit;
    color: inherit;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label.required::after {
    content: ' *';
    color: #dc3545;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
    color: #212529;
    background-color: #fff;
}

.form-input:focus,
.form-select:focus {
    outline: 0;
    border-color: #368BC1;
    box-shadow: 0 0 0 0.2rem rgba(54, 139, 193, 0.25);
}

.form-input::placeholder {
    color: #6c757d;
}

.form-input.error {
    border-color: #dc3545;
}

.form-input.error:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-input.success {
    border-color: #28a745;
}

.form-input.success:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.form-error.show {
    display: block;
}

.form-help {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Password strength indicator */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-bar-fill {
    height: 100%;
    transition: width 0.3s, background-color 0.3s;
    width: 0%;
}

.strength-bar-fill.weak {
    background: #dc3545;
    width: 33%;
}

.strength-bar-fill.medium {
    background: #ffc107;
    width: 66%;
}

.strength-bar-fill.strong {
    background: #28a745;
    width: 100%;
}

.strength-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.strength-text.weak {
    color: #dc3545;
}

.strength-text.medium {
    color: #ffc107;
}

.strength-text.strong {
    color: #28a745;
}

/* ============================================================================
   BUTTONS (matching login page style)
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Public Sans', sans-serif;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn--primary {
    background: linear-gradient(135deg, #368BC1 0%, #2a6d96 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(54, 139, 193, 0.3);
}

.btn--primary:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(54, 139, 193, 0.4);
    transform: translateY(-2px);
}

.btn--secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e1e8ed;
}

.btn--secondary:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #ced4da;
}

.btn--danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn--danger:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
    transform: translateY(-2px);
}

.btn--success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn--success:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px);
}

.btn--outline {
    background: transparent;
    border: 2px solid #368BC1;
    color: #368BC1;
}

.btn--outline:hover:not(:disabled) {
    background: #368BC1;
    color: white;
}

.btn--outline-danger {
    background: transparent;
    border: 2px solid #dc3545;
    color: #dc3545;
}

.btn--outline-danger:hover:not(:disabled) {
    background: #dc3545;
    color: white;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ============================================================================
   ALERTS & MESSAGES
   ============================================================================ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert--success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert--error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert--warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert--info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* ============================================================================
   MODAL
   ============================================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10001;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header.danger {
    background: #dc3545;
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    color: inherit;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.modal-header.danger .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ============================================================================
   ACCOUNT DELETION
   ============================================================================ */

.danger-zone {
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 1.5rem;
    background: #fff5f5;
}

.danger-zone-title {
    color: #dc3545;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.danger-zone-text {
    color: #721c24;
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

/* ============================================================================
   REFERRAL PROGRAM
   ============================================================================ */

/* Referral card header - matches standard card styling */

.referral-intro {
    margin-bottom: 1.5rem;
}

.referral-intro p {
    margin: 0 0 0.5rem;
    color: #495057;
    line-height: 1.6;
}

.referral-intro .referral-benefit {
    color: #368BC1;
    font-weight: 500;
}

.referral-code-box {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.referral-code-label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.referral-code-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.referral-code {
    font-size: 1.75rem;
    font-weight: 700;
    color: #667eea;
    letter-spacing: 2px;
    font-family: 'Roboto Mono', monospace;
}

.referral-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.referral-copy-btn:hover {
    background: #5a6fd6;
    transform: scale(1.05);
}

.referral-copy-btn:active {
    transform: scale(0.95);
}

.referral-copy-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.referral-copy-btn[data-tooltip]:hover::after {
    opacity: 1;
}

.referral-share-url {
    display: flex;
    gap: 0.5rem;
}

.referral-share-url input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #495057;
    background: white;
}

.referral-share-url input:focus {
    outline: none;
    border-color: #667eea;
}

.referral-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
}

.referral-stat {
    text-align: center;
}

.referral-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1.2;
}

.referral-stat-label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* ============================================================================
   EMAIL PREFERENCES
   ============================================================================ */

.email-preferences {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preference-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.preference-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.preference-label {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.preference-description {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.5;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.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: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

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

.toggle-switch input:checked + .toggle-slider {
    background-color: #368BC1;
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(54, 139, 193, 0.25);
}

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

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   THEME SELECTOR (Appearance Settings)
   ============================================================================ */

.theme-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    flex: 1;
}

.theme-option:hover {
    border-color: #368BC1;
    background: #f0f7fc;
}

.theme-option.active {
    border-color: #368BC1;
    background: #e8f4fc;
    box-shadow: 0 0 0 3px rgba(54, 139, 193, 0.15);
}

.theme-option__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.theme-option__icon svg {
    width: 28px;
    height: 28px;
    color: #495057;
}

.theme-option.active .theme-option__icon svg {
    color: #368BC1;
}

/* Light theme icon styling */
.theme-option[data-theme="light"] .theme-option__icon {
    background: #fff8e5;
}

.theme-option[data-theme="light"] .theme-option__icon svg {
    color: #f5a623;
}

/* Dark theme icon styling */
.theme-option[data-theme="dark"] .theme-option__icon {
    background: #2d3748;
}

.theme-option[data-theme="dark"] .theme-option__icon svg {
    color: #a0aec0;
}

/* Auto theme icon styling */
.theme-option[data-theme="auto"] .theme-option__icon {
    background: linear-gradient(135deg, #fff8e5 0%, #2d3748 100%);
}

.theme-option[data-theme="auto"] .theme-option__icon svg {
    color: #667eea;
}

.theme-option__label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
}

.theme-option.active .theme-option__label {
    color: #368BC1;
}

.theme-hint {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.5;
}

/* ============================================================================
   DARK MODE STYLES
   ============================================================================ */

/* Profile Card */
html.dark-mode .profile-card {
    background: #1a1d23 !important;
    border-color: #363c47 !important;
}

html.dark-mode .profile-card-header {
    color: #4a9ed4 !important;
    border-bottom-color: #363c47 !important;
}

html.dark-mode .profile-card-header .menu-icon {
    color: #4a9ed4 !important;
}

html.dark-mode .profile-card-body {
    background: #1a1d23 !important;
}

/* Info Display */
html.dark-mode .info-label {
    color: #9ca3af !important;
}

html.dark-mode .info-value {
    color: #f3f4f6 !important;
}

html.dark-mode .info-value.muted {
    color: #9ca3af !important;
}

/* Badges */
html.dark-mode .badge--success {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
}

html.dark-mode .badge--danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

html.dark-mode .badge--warning {
    background: rgba(251, 191, 36, 0.15) !important;
    color: #fcd34d !important;
}

html.dark-mode .badge--info {
    background: rgba(74, 158, 212, 0.15) !important;
    color: #4a9ed4 !important;
}

html.dark-mode .badge--monthly {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}

html.dark-mode .badge--secondary {
    background: rgba(107, 114, 128, 0.2) !important;
    color: #9ca3af !important;
}

/* Form Elements */
html.dark-mode .form-input,
html.dark-mode .form-select {
    background: #22262e !important;
    border-color: #363c47 !important;
    color: #f3f4f6 !important;
}

html.dark-mode .form-input:focus,
html.dark-mode .form-select:focus {
    border-color: #4a9ed4 !important;
    box-shadow: 0 0 0 0.2rem rgba(74, 158, 212, 0.25) !important;
}

html.dark-mode .form-input::placeholder {
    color: #6b7280 !important;
}

html.dark-mode .form-label {
    color: #9ca3af !important;
}

html.dark-mode .form-error {
    color: #f87171 !important;
}

html.dark-mode .form-help {
    color: #9ca3af !important;
}

/* Password Strength */
html.dark-mode .strength-bar {
    background: #363c47 !important;
}

/* Buttons */
html.dark-mode .btn--secondary {
    background: #22262e !important;
    color: #d1d5db !important;
    border-color: #363c47 !important;
}

html.dark-mode .btn--secondary:hover:not(:disabled) {
    background: #2a2f38 !important;
    border-color: #4a9ed4 !important;
}

html.dark-mode .btn--outline-danger {
    background: transparent !important;
    color: #ef4444 !important;
    border: 2px solid #ef4444 !important;
}

html.dark-mode .btn--outline-danger:hover:not(:disabled) {
    background: #ef4444 !important;
    color: #ffffff !important;
}

/* Alerts */
html.dark-mode .alert--success {
    background: rgba(34, 197, 94, 0.1) !important;
    color: #4ade80 !important;
    border-left-color: #22c55e !important;
}

html.dark-mode .alert--error {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
    border-left-color: #ef4444 !important;
}

html.dark-mode .alert--warning {
    background: rgba(251, 191, 36, 0.1) !important;
    color: #fcd34d !important;
    border-left-color: #fbbf24 !important;
}

html.dark-mode .alert--info {
    background: rgba(74, 158, 212, 0.1) !important;
    color: #4a9ed4 !important;
    border-left-color: #4a9ed4 !important;
}

/* Modal */
html.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

html.dark-mode .modal-content {
    background: #1a1d23 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

html.dark-mode .modal-header {
    border-bottom-color: #363c47 !important;
}

html.dark-mode .modal-header h2 {
    color: #f3f4f6 !important;
}

html.dark-mode .modal-close {
    color: #9ca3af !important;
}

html.dark-mode .modal-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

html.dark-mode .modal-body {
    color: #d1d5db !important;
}

html.dark-mode .modal-footer {
    border-top-color: #363c47 !important;
}

/* Danger Zone */
html.dark-mode .danger-zone {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
}

html.dark-mode .danger-zone-title {
    color: #f87171 !important;
}

html.dark-mode .danger-zone-text {
    color: #fca5a5 !important;
}

/* Referral Card */
html.dark-mode .referral-intro p {
    color: #9ca3af !important;
}

html.dark-mode .referral-code-box {
    background: #22262e !important;
    border-color: #363c47 !important;
}

html.dark-mode .referral-code-label {
    color: #9ca3af !important;
}

html.dark-mode .referral-share-url input {
    background: #1a1d23 !important;
    border-color: #363c47 !important;
    color: #f3f4f6 !important;
}

html.dark-mode .referral-share-url input:focus {
    border-color: #667eea !important;
}

html.dark-mode .referral-stats {
    border-top-color: #363c47 !important;
}

html.dark-mode .referral-stat-label {
    color: #9ca3af !important;
}

/* Email Preferences */
html.dark-mode .preference-item {
    background: #22262e !important;
    border-color: #363c47 !important;
}

html.dark-mode .preference-label {
    color: #f3f4f6 !important;
}

html.dark-mode .preference-description {
    color: #9ca3af !important;
}

/* Toggle Switch */
html.dark-mode .toggle-slider {
    background-color: #363c47 !important;
}

html.dark-mode .toggle-switch input:checked + .toggle-slider {
    background-color: #4a9ed4 !important;
}

/* Theme Selector */
html.dark-mode .theme-option {
    background: #22262e !important;
    border-color: #363c47 !important;
}

html.dark-mode .theme-option:hover {
    background: #2a2f38 !important;
    border-color: #4a9ed4 !important;
}

html.dark-mode .theme-option.active {
    background: rgba(74, 158, 212, 0.1) !important;
    border-color: #4a9ed4 !important;
}

html.dark-mode .theme-option__icon {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html.dark-mode .theme-option__label {
    color: #f3f4f6 !important;
}

html.dark-mode .theme-option.active .theme-option__label {
    color: #4a9ed4 !important;
}

html.dark-mode .theme-hint {
    color: #9ca3af !important;
}

/* Auto dark mode */
@media (prefers-color-scheme: dark) {
    html.dark-mode-auto .profile-card {
        background: #1a1d23 !important;
        border-color: #363c47 !important;
    }

    html.dark-mode-auto .profile-card-header {
        color: #4a9ed4 !important;
        border-bottom-color: #363c47 !important;
    }

    html.dark-mode-auto .profile-card-header .menu-icon {
        color: #4a9ed4 !important;
    }

    html.dark-mode-auto .profile-card-body {
        background: #1a1d23 !important;
    }

    html.dark-mode-auto .info-label {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .info-value {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .info-value.muted {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .badge--success {
        background: rgba(34, 197, 94, 0.15) !important;
        color: #4ade80 !important;
    }

    html.dark-mode-auto .badge--danger {
        background: rgba(239, 68, 68, 0.15) !important;
        color: #f87171 !important;
    }

    html.dark-mode-auto .badge--warning {
        background: rgba(251, 191, 36, 0.15) !important;
        color: #fcd34d !important;
    }

    html.dark-mode-auto .badge--info {
        background: rgba(74, 158, 212, 0.15) !important;
        color: #4a9ed4 !important;
    }

    html.dark-mode-auto .form-input,
    html.dark-mode-auto .form-select {
        background: #22262e !important;
        border-color: #363c47 !important;
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .form-input:focus,
    html.dark-mode-auto .form-select:focus {
        border-color: #4a9ed4 !important;
        box-shadow: 0 0 0 0.2rem rgba(74, 158, 212, 0.25) !important;
    }

    html.dark-mode-auto .form-input::placeholder {
        color: #6b7280 !important;
    }

    html.dark-mode-auto .form-label {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .form-error {
        color: #f87171 !important;
    }

    html.dark-mode-auto .form-help {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .strength-bar {
        background: #363c47 !important;
    }

    html.dark-mode-auto .btn--secondary {
        background: #22262e !important;
        color: #d1d5db !important;
        border-color: #363c47 !important;
    }

    html.dark-mode-auto .btn--secondary:hover:not(:disabled) {
        background: #2a2f38 !important;
        border-color: #4a9ed4 !important;
    }

    html.dark-mode-auto .btn--outline-danger {
        background: transparent !important;
        color: #ef4444 !important;
        border: 2px solid #ef4444 !important;
    }

    html.dark-mode-auto .btn--outline-danger:hover:not(:disabled) {
        background: #ef4444 !important;
        color: #ffffff !important;
    }

    html.dark-mode-auto .alert--success {
        background: rgba(34, 197, 94, 0.1) !important;
        color: #4ade80 !important;
        border-left-color: #22c55e !important;
    }

    html.dark-mode-auto .alert--error {
        background: rgba(239, 68, 68, 0.1) !important;
        color: #f87171 !important;
        border-left-color: #ef4444 !important;
    }

    html.dark-mode-auto .alert--warning {
        background: rgba(251, 191, 36, 0.1) !important;
        color: #fcd34d !important;
        border-left-color: #fbbf24 !important;
    }

    html.dark-mode-auto .alert--info {
        background: rgba(74, 158, 212, 0.1) !important;
        color: #4a9ed4 !important;
        border-left-color: #4a9ed4 !important;
    }

    html.dark-mode-auto .modal-overlay {
        background: rgba(0, 0, 0, 0.7) !important;
    }

    html.dark-mode-auto .modal-content {
        background: #1a1d23 !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    }

    html.dark-mode-auto .modal-header {
        border-bottom-color: #363c47 !important;
    }

    html.dark-mode-auto .modal-header h2 {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .modal-close {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .modal-close:hover {
        background: rgba(255, 255, 255, 0.1) !important;
    }

    html.dark-mode-auto .modal-body {
        color: #d1d5db !important;
    }

    html.dark-mode-auto .modal-footer {
        border-top-color: #363c47 !important;
    }

    html.dark-mode-auto .danger-zone {
        background: rgba(239, 68, 68, 0.1) !important;
        border-color: #ef4444 !important;
    }

    html.dark-mode-auto .danger-zone-title {
        color: #f87171 !important;
    }

    html.dark-mode-auto .danger-zone-text {
        color: #fca5a5 !important;
    }

    html.dark-mode-auto .referral-intro p {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .referral-code-box {
        background: #22262e !important;
        border-color: #363c47 !important;
    }

    html.dark-mode-auto .referral-code-label {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .referral-share-url input {
        background: #1a1d23 !important;
        border-color: #363c47 !important;
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .referral-share-url input:focus {
        border-color: #667eea !important;
    }

    html.dark-mode-auto .referral-stats {
        border-top-color: #363c47 !important;
    }

    html.dark-mode-auto .referral-stat-label {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .preference-item {
        background: #22262e !important;
        border-color: #363c47 !important;
    }

    html.dark-mode-auto .preference-label {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .preference-description {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .toggle-slider {
        background-color: #363c47 !important;
    }

    html.dark-mode-auto .toggle-switch input:checked + .toggle-slider {
        background-color: #4a9ed4 !important;
    }

    html.dark-mode-auto .theme-option {
        background: #22262e !important;
        border-color: #363c47 !important;
    }

    html.dark-mode-auto .theme-option:hover {
        background: #2a2f38 !important;
        border-color: #4a9ed4 !important;
    }

    html.dark-mode-auto .theme-option.active {
        background: rgba(74, 158, 212, 0.1) !important;
        border-color: #4a9ed4 !important;
    }

    html.dark-mode-auto .theme-option__icon {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }

    html.dark-mode-auto .theme-option__label {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .theme-option.active .theme-option__label {
        color: #4a9ed4 !important;
    }

    html.dark-mode-auto .theme-hint {
        color: #9ca3af !important;
    }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .theme-selector {
        flex-direction: column;
    }

    .theme-option {
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .theme-option__icon {
        width: 40px;
        height: 40px;
    }

    .theme-option__icon svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 768px) {
    .profile-container {
        padding: 0 0.5rem 1rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }

    .referral-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .referral-stat-value {
        font-size: 1.25rem;
    }

    .referral-stat-label {
        font-size: 0.7rem;
    }

    .referral-code {
        font-size: 1.25rem;
    }

    .referral-share-url {
        flex-direction: column;
    }

    .referral-share-url input {
        width: 100%;
    }
}

/* ============================================================================
   SWITCH PLAN MODAL
   ============================================================================ */

.modal--large {
    max-width: 700px;
    width: 95%;
}

.switch-plan-desc {
    color: var(--text-secondary, #6c757d);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.switch-plan-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    gap: 1rem;
    color: var(--text-secondary, #6c757d);
}

.switch-plan-loading .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.switch-plan-error,
.switch-plan-ineligible,
.switch-plan-pending {
    padding: 1rem 0;
}

.switch-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    overflow: visible;
    padding: 0.5rem;
}

.switch-plan-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary, #fff);
    border: 2px solid var(--border-color, #e9ecef);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.switch-plan-card:hover {
    border-color: var(--primary, #368BC1);
    box-shadow: 0 4px 12px rgba(54, 139, 193, 0.15);
}

.switch-plan-card.selected {
    border-color: var(--primary, #368BC1) !important;
    border-width: 3px !important;
    background: rgba(54, 139, 193, 0.1) !important;
    box-shadow: 0 0 0 4px rgba(54, 139, 193, 0.25), 0 4px 12px rgba(54, 139, 193, 0.2) !important;
    transform: scale(1.02);
}

.switch-plan-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.switch-plan-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin: 0;
}

.switch-plan-type {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin: 0 auto;
}

.switch-plan-type.monthly {
    background: rgba(54, 139, 193, 0.1);
    color: var(--primary, #368BC1);
}

.switch-plan-type.annual {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success, #28a745);
}

.switch-plan-price {
    margin-bottom: 0.75rem;
}

.switch-plan-price .price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
}

.switch-plan-price .price-value::before {
    content: '\20AC';
    font-size: 1rem;
    font-weight: 500;
    margin-right: 2px;
}

.switch-plan-savings {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success, #28a745);
    background: rgba(40, 167, 69, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin: 0.5rem 0;
    text-align: center;
}

.switch-plan-description {
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
    margin: 0 0 1rem 0;
}

.switch-plan-select-btn {
    width: 100%;
    margin-top: auto;
    transition: all 0.2s ease;
}

.switch-plan-card.selected .switch-plan-select-btn {
    background: var(--primary, #368BC1);
    border-color: var(--primary, #368BC1);
    color: white;
}

.switch-plan-card.selected .switch-plan-select-btn::before {
    content: '\2713';
    margin-right: 0.5rem;
    font-weight: bold;
}

.switch-plan-activation-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(54, 139, 193, 0.05);
    border-radius: 8px;
    color: var(--primary, #368BC1);
    font-size: 0.9rem;
}

.switch-plan-activation-info svg {
    flex-shrink: 0;
}

/* Dark mode support */
.dark-mode .switch-plan-card {
    background: var(--bg-secondary, #2d3748);
    border-color: var(--border-color, #4a5568);
}

.dark-mode .switch-plan-card:hover {
    border-color: var(--primary, #4299e1);
}

.dark-mode .switch-plan-card.selected {
    background: rgba(66, 153, 225, 0.15) !important;
    border-color: var(--primary, #4299e1) !important;
    border-width: 3px !important;
    box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.25), 0 4px 12px rgba(66, 153, 225, 0.2) !important;
}

.dark-mode .switch-plan-name {
    color: var(--text-primary, #fff);
}

.dark-mode .switch-plan-price .price-value {
    color: var(--text-primary, #fff);
}

.dark-mode .switch-plan-activation-info {
    background: rgba(66, 153, 225, 0.1);
}

/* Switch Plan Discount Section */
.switch-plan-discount {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary, #f7f7f7);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
}

/* Promo Suggestion Banner */
.promo-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(56, 178, 172, 0.1) 100%);
    border: 1px solid var(--success-color, #48bb78);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.promo-suggestion-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.promo-suggestion-icon {
    font-size: 1.25rem;
}

.promo-suggestion-text {
    font-size: 0.875rem;
    color: var(--text-primary, #212529);
}

.promo-suggestion-text strong {
    color: var(--success-color, #48bb78);
    font-weight: 700;
}

.promo-suggestion .btn--success {
    flex-shrink: 0;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.dark-mode .promo-suggestion {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.15) 0%, rgba(56, 178, 172, 0.15) 100%);
}

.dark-mode .promo-suggestion-text {
    color: var(--text-primary, #fff);
}

.discount-input-group {
    display: flex;
    gap: 0.5rem;
}

.discount-input-group input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.discount-input-group input:focus {
    outline: none;
    border-color: var(--primary-color, #3182ce);
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.1);
}

.discount-input-group input:disabled {
    background: var(--bg-tertiary, #e2e8f0);
    color: var(--text-secondary, #718096);
    cursor: not-allowed;
}

.discount-input-group .btn--sm {
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.discount-input-group .btn--success {
    background: var(--success-color, #48bb78);
    border-color: var(--success-color, #48bb78);
    color: white;
}

.discount-message {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.813rem;
}

.discount-message.success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color, #48bb78);
}

.discount-message.error {
    background: rgba(245, 101, 101, 0.1);
    color: var(--danger-color, #f56565);
}

/* Discounted Price Display */
.price-original {
    text-decoration: line-through;
    color: var(--text-secondary, #718096);
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.price-original::before {
    content: '\20AC';
    font-size: 0.75rem;
    margin-right: 1px;
}

.price-discounted {
    color: var(--success-color, #48bb78);
    font-weight: 600;
}

.switch-plan-discount-badge {
    display: inline-block;
    background: var(--success-color, #48bb78);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

/* Dark mode discount styles */
.dark-mode .switch-plan-discount {
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--border-color-dark, #4a5568);
}

.dark-mode .discount-input-group input {
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--border-color-dark, #4a5568);
    color: var(--text-primary, #fff);
}

.dark-mode .discount-input-group input:focus {
    border-color: var(--primary-color, #4299e1);
}

.dark-mode .discount-input-group input:disabled {
    background: rgba(0, 0, 0, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal--large {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .switch-plan-grid {
        grid-template-columns: 1fr;
    }

    .switch-plan-card {
        padding: 1rem;
    }

    .switch-plan-price .price-value {
        font-size: 1.25rem;
    }
}
