/*
================================================================
Serensip Child Theme - My Account Global Stylesheet V2 (Refactored)
- This is a complete, reorganized version of the original stylesheet.
- No styles have been removed; they have been consolidated for
  maintainability and to eliminate repetition.
================================================================
*/

/*
==============================================
--- 1. SETTINGS: VARIABLES & THEMES (REFINED) ---
==============================================
*/


/* --- Base Variables (Light Mode Default) --- */
:root {
    /* Colors */
    --bg-color: #f4f7fa;
    --card-bg-color: #ffffff;
    --text-color: #1a1f36;
    --text-secondary-color: #6c757d;
    --border-color: #e9ecef;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #e74c3c;
    --danger-hover-color: #c0392b;

    /* Accent Theme (Default Blue) */
    --accent-color: #007bff;
    --accent-hover-color: #0056b3;

    /* Sizing & Radius */
    --border-radius-sm: 8px;
    --border-radius-lg: 12px;
}

/* --- Dark Mode Overhaul --- */
html[data-theme="dark"] {
    --bg-color: #1A202C; /* Dark Slate Blue */
    --card-bg-color: #2D3748; /* Lighter Slate Blue */
    --text-color: #E2E8F0; /* Off-white */
    --text-secondary-color: #A0AEC0; /* Light Gray */
    --border-color: #4A5568; /* Mid Gray */
    --shadow-color: rgba(0, 0, 0, 0.4);
    --success-color: #38A169; /* Desaturated Green */
    --warning-color: #D69E2E; /* Desaturated Yellow/Orange */
}

/* --- Global Color Theme Definitions --- */
html[data-color-theme="green"] {
    --accent-color: #2ecc71;
    --accent-hover-color: #27ae60;
}
html[data-color-theme="red"] {
    --accent-color: #e74c3c;
    --accent-hover-color: #c0392b;
}

/* --- Dark Mode Specific Accent Adjustments --- */
html[data-theme="dark"][data-color-theme="blue"] {
    --accent-color: #3182CE;
    --accent-hover-color: #2B6CB0;
}
html[data-theme="dark"][data-color-theme="green"] {
    --accent-color: #38A169;
    --accent-hover-color: #2F855A;
}
html[data-theme="dark"][data-color-theme="red"] {
    --accent-color: #E53E3E;
    --accent-hover-color: #C53030;
}

/* Make general links and the 'Set' link use the new desaturated accent color */
html[data-theme="dark"] .security-item a,
html[data-theme="dark"] .forgot-password-link {
    color: var(--accent-color) !important;
}

/*
==============================================
--- 2. BASE STYLES ---
==============================================
*/

/* --- Targeted fix to contain the header's own overflow --- */
/*
================================================================
--- Final & Combined Fix for Page Overflow & Clipped Header ---
================================================================
*/

/* 1. Hide horizontal overflow on the primary page container.
      This is the confirmed fix for the unwanted space on the right. */
#page-container {
    overflow-x: hidden;
}

/* 2. Give the header a position and a high z-index. This lifts it
      into its own stacking context, helping it to display correctly
      on top of other page content and "escape" the parent's
      overflow clipping. */
/* assets/css/my-account-styles.css */

.gemini-main-header {
    position: relative;
    z-index: 9998; /* A high value to ensure it's on top */
}

/* 3. Explicitly ensure the header itself can show overflowing dropdown
      menus. The !important flag is crucial to override any
      conflicting styles from the parent theme. */
#main-header {
    overflow: visible !important;
}

/* The corrected rule */
body {
    font-family: -apple-system, BlinkMacMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

/* Consolidated Divider Style */
hr.card-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

/* Hides browser-native password toggle icons */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-password-management-button {
    display: none !important;
    -webkit-appearance: none !important;
}

/*
==============================================
--- 3. LAYOUTS ---
==============================================
*/

/* Adds breathing room between the dashboard and the footer */
.gemini-account-container {
    margin-bottom: 4rem; /* Creates 64px of space. You can adjust this value. */
}

/* General page header (used on dashboard, etc.) */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Specific header for the Edit Profile page */
.edit-profile-header {
    margin-bottom: 2rem;
    text-align: left;
}

.header-title h1,
.edit-profile-header h1 {
    margin: 0 0 0.25rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.header-title p,
.edit-profile-header p {
    margin: 0;
    color: var(--text-secondary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Grid Layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.edit-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch; /* Makes cards equal height */
    margin-bottom: 1.5rem;
}

/* Centered layout for Login/Signup pages */
#login-container,
#signup-container,
#password-success-container {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 80vh;
    padding: 2rem 0;
}

/* Footer for forms with right-aligned actions */
.form-actions-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/*
==============================================
--- 4. COMPONENTS ---
==============================================
*/

/* --- Component: Buttons (.btn) ---
 * All button types have been consolidated here.
 * HOW TO USE:
 * - Primary: class="btn"
 * - Secondary: class="btn btn--secondary"
 * - Danger: class="btn btn--danger"
 * - Link Style: class="btn btn--action-link"
 * - Danger Text: class="btn btn--danger-text"
 * - Disabled: Add the `disabled` attribute to any button.
 *-------------------------------------------------------------*/
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    text-decoration: none !important;
    transition: all 0.2s ease-in-out;
    line-height: 1.5;
    background-color: var(--accent-color);
    color: #fff !important;
}
.btn:hover {
    background-color: var(--accent-hover-color);
    transform: translateY(-2px); /* Switched from scale to translate */
}

/* Modifier: Secondary */
.btn--secondary {
    background-color: transparent;
    border-color: #dcdcdc; /* Specific color from original modal button */
    color: var(--text-color) !important;
}
.btn--secondary:hover {
    background-color: #f7f7f7; /* Specific color from original modal button */
    border-color: #c5c5c5;
    transform: translateY(-2px);
}

/* Modifier: Action Link (another secondary style) */
.btn--action-link {
    padding: 6px 16px;
    background-color: #fdfdfd;
    border-color: #e0e0e0;
    color: var(--text-color) !important;
}
.btn--action-link:hover {
    border-color: var(--accent-color);
    background-color: color-mix(in srgb, var(--accent-color) 5%, transparent);
    transform: none; /* Original did not have a transform */
}

/* Modifier: Danger */
.btn--danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: #fff !important;
}
.btn--danger:hover {
    background-color: var(--danger-hover-color);
    border-color: var(--danger-hover-color);
    transform: translateY(-2px);
}

/* Modifier: Danger Text */
.btn--danger-text {
    padding: 0 !important;
    background-color: transparent !important;
    border-color: transparent !important;
    color: var(--danger-color) !important;
}
.btn--danger-text:hover {
    opacity: 0.7;
    background-color: transparent !important;
}

/* State: Disabled (applies to ALL button types) */
.btn:disabled,
.btn[disabled] {
    background-color: var(--border-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary-color) !important;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}


/* --- Component: Cards (.card) --- */
.card {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease-in-out;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-color);
    border-color: var(--accent-color);
}
.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.card-header .icon { color: var(--accent-color); }
.card-header h3 { margin: 0; font-size: 1.25rem; }
.card-content {
    line-height: 1.6;
    color: var(--text-secondary-color);
    flex-grow: 1; /* Helps with equal-height columns */
}
.card-content p { margin: 0.5rem 0; }
.card-content strong { color: var(--text-color); }

/* Card Variation: Dashboard Card (fixed height with footer space) */
.dashboard-grid .card {
    position: relative;
    min-height: 400px;
    padding-bottom: 6rem; /* Space for the absolutely positioned .card-actions */
}

/* Card Variation: Edit Profile Card (auto height) */
.edit-profile-grid .card {
    min-height: auto;
}
.edit-profile-grid .card-content {
    display: flex; /* Helps vertically center content in shorter cards */
    flex-direction: column;
    justify-content: center;
}

/* Card Variation: Login Card */
.login-card {
    max-width: 450px;
    width: 100%;
    padding: 2.5rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}
.login-card .login-header { text-align: center; margin-bottom: 2rem; }
.login-card .login-header .feather { width: 32px; height: 32px; color: var(--accent-color); margin-bottom: 1rem; }
.login-card .login-header h3 { font-size: 1.75rem; margin: 0 0 0.5rem 0; color: var(--text-color); }
.login-card .login-header p { margin: 0; color: var(--text-secondary-color); }
.login-card .form-actions { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.login-card .form-actions .btn { width: 100%; margin: 0 !important; }

/* Positioned actions footer for dashboard cards */
.card-actions {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--card-bg-color);
    border-bottom-left-radius: var(--border-radius-lg);
    border-bottom-right-radius: var(--border-radius-lg);
}


/* --- Component: Forms (.form-group, etc) --- */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}
.edit-profile-grid .form-group + .form-group {
    margin-top: 1.5rem; /* Specific spacing from original file */
}
.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.form-group small {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary-color);
}
.label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.forgot-password-link {
    font-size: 0.85rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}
.forgot-password-link:hover { text-decoration: underline; }

/* Universal Input Style (replaces all separate input styles) */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 15%, transparent);
}
.form-group input:disabled {
    background-color: color-mix(in srgb, var(--border-color) 50%, var(--bg-color));
    cursor: not-allowed;
    opacity: 0.7;
}

/* Password field with show/hide toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-input-wrapper input { padding-right: 3rem; }
.password-toggle-btn {
    position: absolute;
    right: 0.25rem;
    top: 0;
    height: 100%;
    width: 3rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary-color);
    display: grid;
    place-items: center;
    padding: 0;
}
.password-toggle-btn:hover { color: var(--accent-color); }


/* --- Component: Feedback & Validation Messages --- */
/* This is a more specific selector to win against theme conflicts */
.gemini-account-container .feedback-message {
    display: none;
    align-items: center !important; /* <--- THIS IS THE FIX */
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.feedback-message .feedback-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* Modifier: Success */
.feedback-message.success {
    background-color: #eaf6ec; /* From enhanced version */
    color: var(--success-color);
    border-color: var(--success-color);
}

/* Modifier: Error (replaces .login-error-message) */
.feedback-message.error {
    background-color: #fbeae9; /* From enhanced version */
    color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Small, inline validation error text */
.validation-error {
    display: none;
    color: var(--danger-color);
    font-size: 0.8rem;
}


/* --- Component: Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    background: var(--card-bg-color);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 450px;
    text-align: center;
    transform: scale(0.9);
    transition: all 0.3s ease-in-out;
}
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-content h3 { margin-top: 0; }
.modal-content p { color: var(--text-secondary-color); margin-bottom: 2rem; }
.modal-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
/* Override padding and set min-width for buttons inside a modal */
.modal-actions .btn {
    min-width: 120px;
    padding: 12px 24px;
}
/* Style for validation text inside a modal */
.modal-content .validation-error {
    display: block; /* Override default 'none' to be visible */
    margin-top: 0.5rem;
    text-align: left;
}


/* --- Component: Theme Toggles --- */
.theme-switch-wrapper { display: flex; align-items: center; gap: 0.5rem; }
.theme-switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.theme-switch input { display:none; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(26px); }

.swatch-container { display: flex; gap: 0.75rem; align-items: center; }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; transition: all 0.2s ease; border: 2px solid var(--card-bg-color); box-shadow: 0 0 0 1px var(--border-color); }
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { box-shadow: 0 0 0 2px var(--accent-color); }
.swatch-blue { background-color: #007bff; }
.swatch-green { background-color: #2ecc71; }
.swatch-red { background-color: #e74c3c; }


/* --- Component: Profile & Security Elements --- */
.profile-info { display: flex; align-items: center; margin-bottom: 1rem; gap: 1rem; }
.profile-info img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.profile-info h4 { margin: 0 0 0.25rem 0; font-size: 1.1rem; }
.profile-info p { margin: 0; font-size: 0.9rem; }

.profile-picture-area { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
#profile-avatar-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; background-color: var(--border-color); }
.profile-picture-actions { display: flex; flex-direction: column; justify-content: center; gap: 0.5rem; }
.profile-picture-actions p { margin: 0; }

.profile-detail-list,
.security-detail-list { margin: 1.5rem 0; display: flex; flex-direction: column; gap: 1rem; }
.profile-detail-item,
.security-detail-item { display: flex; align-items: center; gap: 0.75rem; color: var(--text-color); font-size: 0.95rem; }
.profile-detail-item .detail-icon,
.security-detail-item .detail-icon { width: 20px; height: 20px; color: var(--text-secondary-color); }
.profile-detail-item .missing { color: var(--text-secondary-color); font-style: italic; }

.security-item { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; }
.security-item span { display: flex; align-items: center; gap: 0.5rem; }
.security-detail-item .status-text { margin-left: auto; font-weight: 600; }
.status-on, .status-text.status-on { color: var(--success-color); }
.status-off { color: var(--warning-color); } /* From original .security-item */
.status-text.status-off { color: var(--text-secondary-color); } /* From new .security-detail-item */

.danger-zone { border-color: var(--danger-color) !important; }
.danger-zone .icon { color: var(--danger-color); }

/* --- Component: Progress, Score & Checklists --- */
.profile-completion { margin-bottom: 1.5rem; }
.completion-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary-color); }
.progress-bar-wrapper { width: 100%; height: 8px; background-color: var(--border-color); border-radius: var(--border-radius-sm); overflow: hidden; }
.progress-bar-fill { height: 100%; background-color: var(--accent-color); border-radius: var(--border-radius-sm); transition: width 0.5s ease-in-out; }

.security-score { text-align: center; margin-bottom: 1.5rem; }
.score-circle { position: relative; width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 0.5rem; display: flex; justify-content: center; align-items: center; font-weight: bold; color: var(--text-color); background: var(--border-color); }
.score-circle span, #security-score-circle span { font-size: 1.5rem; font-weight: bold; } /* Combines rules */

.strength-meter { margin-top: 1rem; }
.strength-bar { width: 0%; height: 6px; background-color: var(--border-color); border-radius: 6px; transition: all 0.3s ease-in-out; }
.strength-bar.weak { width: 33%; background-color: var(--danger-color); }
.strength-bar.medium { width: 66%; background-color: var(--warning-color); }
.strength-bar.strong { width: 100%; background-color: var(--success-color); }

.requirements-checklist { margin-top: 1rem; }
.requirements-checklist ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; font-size: 0.9rem; }
.requirements-checklist li { color: var(--text-secondary-color); transition: color 0.3s; display: flex; align-items: center; gap: 0.5rem; }
.requirements-checklist li::before { content: '•'; font-size: 1.25rem; line-height: 1; }
.requirements-checklist li.met { color: var(--success-color); }
.requirements-checklist li.met::before { content: '✔'; font-size: 1rem; }

/* --- Component: Security Hub Note --- */
.security-hub-note { display: flex; align-items: center; justify-content: center; gap: 0.75rem; text-align: center; margin-top: 1.5rem; padding: 1rem; background-color: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); color: var(--text-secondary-color); font-size: 0.9rem; }
.security-hub-note .feather { width: 18px; height: 18px; color: var(--text-secondary-color); }
.security-hub-note a { color: var(--accent-color); font-weight: 600; text-decoration: none; }
.security-hub-note a:hover { text-decoration: underline; }


/*
==============================================
--- 5. RESPONSIVE STYLES ---
==============================================
*/

/* On smaller screens, stack the grid into a single column */
@media (max-width: 980px) {
    .edit-profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body { padding: 1rem; }
    .header { flex-direction: column; align-items: flex-start; }
    .form-grid { grid-template-columns: 1fr; }
    .requirements-checklist ul { grid-template-columns: 1fr; }
}
/*
==============================================
--- 6. DEDICATED SUCCESS PAGE STYLES (v2) ---
==============================================
*/

/* --- Page Layout --- */
#password-success-container {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 80vh;
    padding: 2rem 0;
}

/* --- Animated Checkmark --- */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem auto;
    /* Animate the circle scaling into view */
    animation: scale .3s ease-in-out both;
}

/* This rule now simply fills the circle with green. No animation. */
.success-checkmark__circle {
    fill: var(--success-color);
    stroke: none;
}

/* This rule draws the white checkmark on top */
.success-checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #fff; /* The white tick */
    stroke-width: 3;
    /* The animation starts after a 0.4s delay to let the circle appear first */
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

/* --- Keyframe Animations --- */
@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes scale {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* --- Button Layout --- */
#password-success-container .form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 480px) {
    #password-success-container .form-actions {
        flex-direction: row;
        justify-content: center;
    }
}
/*
==============================================
--- MAGIC LINK MODAL STYLES ---
==============================================
*/

#magic-link-modal .modal-content {
    max-width: 480px; /* A bit wider for the form */
}

#magic-link-modal input[type="email"] {
    width: 100%;
    box-sizing: border-box; /* Ensure padding doesn't break layout */
}
/*
================================================================
--- X. DARK MODE OVERHAUL & FIXES (Corrected Syntax) ---
================================================================
*/

/* --- 1. Fix Visibility on Core Elements --- */
html[data-theme="dark"] .header-title h1,
html[data-theme="dark"] .edit-profile-header h1,
html[data-theme="dark"] .card-header h3,
html[data-theme="dark"] .card-content strong,
html[data-theme="dark"] .profile-info h4,
html[data-theme="dark"] .profile-detail-item,
html[data-theme="dark"] .login-card .login-header h3,
html[data-theme="dark"] .security-item span {
    color: var(--text-color);
}

html[data-theme="dark"] .card-header .icon {
    color: var(--accent-color);
}

/* --- 2. Card Refinements --- */
html[data-theme="dark"] .card {
    border-color: var(--border-color);
}
html[data-theme="dark"] .card:hover {
    border-color: var(--accent-color); /* Brighter border on hover */
    box-shadow: 0 8px 25px var(--shadow-color);
}

/* --- 3. Button Refinements --- */
html[data-theme="dark"] .btn--secondary {
    border-color: var(--border-color);
}
html[data-theme="dark"] .btn--secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary-color);
}

/* --- ADD THIS NEW RULE FOR THE ACTION LINK BUTTON --- */
html[data-theme="dark"] .btn--action-link {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary-color) !important;
}
html[data-theme="dark"] .btn--action-link:hover {
    background-color: color-mix(in srgb, var(--accent-color) 10%, transparent);
    border-color: var(--accent-color);
    color: var(--accent-color) !important;
}

/* --- 4. Form Input Refinements --- */
html[data-theme="dark"] .form-group input[type="text"],
html[data-theme="dark"] .form-group input[type="email"],
html[data-theme="dark"] .form-group input[type="tel"],
html[data-theme="dark"] .form-group input[type="password"],
html[data-theme="dark"] .form-group textarea {
    background-color: var(--bg-color); /* Match main background */
    border-color: var(--border-color);
}
html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group textarea:focus {
    background-color: var(--card-bg-color); /* Slightly lighter on focus */
}

/* --- 5. Feedback Message Refinements --- */
html[data-theme="dark"] .feedback-message.success {
    background-color: rgba(56, 161, 105, 0.1);
    color: #68D391; /* Lighter Green */
    border-color: rgba(56, 161, 105, 0.5);
}
html[data-theme="dark"] .feedback-message.error {
    background-color: rgba(229, 62, 62, 0.1);
    color: #FC8181; /* Lighter Red */
    border-color: rgba(229, 62, 62, 0.5);
}
/*
================================================================
--- DIVI THEME INTEGRATION FIX ---
================================================================
*/

/*
 * This rule forces Divi's main page container to respect our
 * theme's background color, overriding the default white.
 * The !important flag ensures this rule wins against any
 * aggressive styles from the parent theme.
 */
#page-container {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    background-color: var(--bg-color) !important;
}
/* --- Fix for Low-Contrast Header Text --- */
html[data-theme="dark"] .header-title h1 {
    color: var(--text-color);
}

html[data-theme="dark"] .header-title p {
    color: var(--text-secondary-color);
}
/* --- UI Element Polish for Dark Mode --- */

/* Ensure theme toggle icons are always visible */
html[data-theme="dark"] .theme-switch-wrapper {
    color: var(--text-secondary-color);
}

/* Optional: Slightly tone down the color swatches in dark mode */
html[data-theme="dark"] .color-swatch {
    opacity: 0.9;
}
html[data-theme="dark"] .color-swatch.active {
    opacity: 1;
}
/*
================================================================
--- Definitive Divi Dark Mode Integration Fix ---
================================================================
*/

/*
 * 1. Force all primary Divi containers to adopt our dark background.
 * This targets the body, the outer page container, and the inner
 * main content area to ensure there are no white layers left.
 */
html[data-theme="dark"] body,
html[data-theme="dark"] #page-container,
html[data-theme="dark"] #main-content {
    background-color: var(--bg-color) !important;
}

/*
 * 2. Force the greeting text to be fully visible.
 * By using the #account-container ID, we make this rule more
 * specific than Divi's default text styling for the module.
 */
html[data-theme="dark"] #account-container .header-title h1 {
    color: var(--text-color) !important;
}
html[data-theme="dark"] #account-container .header-title p {
    color: var(--text-secondary-color) !important;
}

/*
================================================================
--- Final Fix: Custom Account Container Background ---
================================================================
*/

/*
 * This rule directly targets YOUR custom #account-container div.
 * It sets its background to our dark mode variable, ensuring
 * that the area behind the cards matches the rest of the page
 * and overriding any default white backgrounds from Divi.
 */
html[data-theme="dark"] .et_pb_section {
    background-color: transparent !important;
}

html[data-theme="dark"] #account-container {
    background-color: var(--bg-color);
}
/*
================================================================
--- PRE-AUTHENTICATION VISIBILITY FIX ---
================================================================
*/

/* Hide sensitive page containers by default to prevent content flash */
/*
================================================================
--- AUTH-AWAITING STYLES ---
================================================================
*/

/* This class will be added to the body when a PIN prompt is active */
body.awaiting-auth {
    /* Prevents scrolling the background page */
    overflow: hidden;
}

/* This rule targets the page content when the body has the awaiting-auth class */
body.awaiting-auth .gemini-account-container {
    /* Blur the background content */
    filter: blur(5px);
    /* Make it unclickable */
    pointer-events: none;
    /* Ensure it's visible so the blur can be seen */
    visibility: visible;
    opacity: 1;
    /* Add a smooth transition for when the blur is removed */
    transition: filter 0.3s ease;
}

/* Helper class to prevent the body from scrolling when a modal is active */
body.modal-open-no-scroll {
    overflow: hidden;
}
/*
================================================================
--- V3 DASHBOARD CARD STYLES (Apparel Theme) ---
================================================================
*/

/* --- 1. General Enhancements & Empty States --- */
.card-actions .btn--action-link {
    margin-left: auto; /* Pushes secondary link to the right */
}

.empty-state-text {
    font-size: 0.9rem;
    color: var(--text-secondary-color);
    text-align: center;
    padding: 2rem 1rem;
    font-style: italic;
}


/* --- 2. My Orders Card --- */
.order-status-tracker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
}
.status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    color: var(--text-secondary-color);
    transition: color 0.4s ease;
}
.status-step div {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: grid;
    place-items: center;
    transition: all 0.4s ease;
}
.status-step .feather {
    width: 20px;
    height: 20px;
}
.status-step span {
    font-size: 0.8rem;
    font-weight: 500;
}
.status-line {
    flex-grow: 1;
    height: 2px;
    background-color: var(--border-color);
    position: relative;
    transition: background-color 0.4s ease;
}
/* Active states */
.status-step.active {
    color: var(--accent-color);
}
.status-step.active div {
    border-color: var(--accent-color);
    background-color: var(--accent-color);
    color: #fff;
}
.status-step.active + .status-line {
    background-color: var(--accent-color);
}


/* --- 3. Clover Rewards Card (Revised Layout) --- */
.rewards-balance {
    display: flex;
    flex-direction: column; /* Stacks the number and label vertically */
    align-items: center;   /* Centers them horizontally */
    justify-content: center;
    text-align: center;
    margin-bottom: 1rem;   /* Adds a bit more space below */
}
.rewards-balance #clover-balance {
    font-size: 3.5rem;     /* Makes the number slightly larger for more impact */
    font-weight: 700;
    line-height: 1;
    color: var(--accent-color); /* The number keeps the accent color */
}
.rewards-balance h4 {
    font-size: 1rem;       /* Makes the label smaller */
    margin: 0.25rem 0 0 0;
    font-weight: 500;
    color: var(--text-secondary-color); /* Uses a more subtle color for the label */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.card-content > p {
    text-align: center;
    margin-top: 0;
}

/* --- 4. My Wishlist Card --- */
.wishlist-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}
.wishlist-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

/* --- 5. Style & Fit Profile Card --- */
.style-profile-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.style-profile-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}
.style-profile-list li strong {
    color: var(--text-color);
}
.style-profile-list li span {
    font-weight: 600;
    color: var(--accent-color);
}

/* --- Interactive Avatar Uploader Styles --- */
.avatar-upload-wrapper {
    position: relative;
    width: 80px; /* Match your preview image size */
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden; /* Ensures overlay corners are rounded */
}

.avatar-upload-wrapper #profile-avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.avatar-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-upload-wrapper:hover #profile-avatar-preview {
    filter: brightness(0.8);
}

.avatar-upload-wrapper:hover .avatar-upload-overlay {
    opacity: 1;
}

#upload-status {
    color: var(--accent-color);
}
/*
================================================================
--- FINAL PIN PROTECTION VISIBILITY FIX ---
================================================================
*/

/* Hide the container by default to prevent content flash */
#edit-profile-container {
    visibility: hidden;
}

/* Style for when the PIN prompt is active */
body.awaiting-auth .gemini-account-container {
    visibility: visible; /* Make it visible to apply the blur */
    filter: blur(5px);
    pointer-events: none;
    transition: filter 0.3s ease;
}