/* =================================
   NEW & BEST SETTINGS PAGE STYLES
   ================================= */
:root {
    /* Core Colors */
    --primary-color: #A3C86C;
    --primary-dark: #7D9A4D;
    --primary-light: #B8D88A;
    --primary-extra-light: #F3F7E1;
    /* Secondary Accent */
    --accent-color: #F9D34E;
    /* Backgrounds */
    --background-white: #FFFFFF;
    --background-light: #F1F8E4;
    /* Text Colors */
    --text-color: #4F4A35;
    --text-light: #7D7B55;
    --text-lighter: #A4A38F;
    --text-on-primary: #FFFFFF;
    /* Divider and Hover Effects */
    --divider-color: rgba(163, 200, 108, 0.2);
    /* Special Elements */
    --error-red: #B71C1C;
    /* Other vars */
    --radius: 16px;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.settings-page-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.settings-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.settings-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
}

.settings-header p {
    font-size: 1rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .settings-grid {
        grid-template-columns: 300px 1fr;
    }
}

/* --- Profile Card (Left Column) --- */
.profile-card {
    background: var(--background-white);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-medium);
    text-align: center;
    align-self: start;
    position: sticky;
    top: 100px;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: 600;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--background-white);
    box-shadow: 0 0 0 4px var(--primary-color);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-card h3 {
    font-size: 1.4rem;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
}

.email-display {
    color: var(--text-light);
    word-break: break-all;
}

.member-since {
    font-size: 0.85rem;
    color: var(--text-lighter);
    margin-top: 1rem;
}


/* --- Settings Cards (Right Column) --- */
.settings-cards-wrapper {
    display: grid;
    gap: 2rem;
}

.settings-card {
    background: var(--background-white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--divider-color);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--divider-color);
    font-size: 1.3rem;
    color: var(--primary-dark);
}

.card-title i { font-size: 1.1rem; }

/* Address Settings */
#currentAddressText {
    margin: 0 0 1.5rem 0;
    color: var(--text-light);
    line-height: 1.6;
    background: var(--background-light);
    padding: 1rem;
    border-radius: 8px;
}

.address-display .action-button { float: right; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
}
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-extra-light);
}

.form-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 1rem; }

/* Notification & Security Settings */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--divider-color);
}

.setting-item:last-child { border-bottom: none; padding-bottom: 0; }
.setting-item:first-child { padding-top: 0; }

.setting-info h4 { margin: 0 0 0.3rem 0; color: var(--text-color); }
.setting-info p { margin: 0; color: var(--text-light); font-size: 0.9rem; }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 24px; }
.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(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }

/* Buttons */
.action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--primary-color);
    color: white;
}
.action-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.action-button.secondary {
    background: var(--hover-gray);
    color: var(--text-color);
}
.action-button.secondary:hover {
    background: var(--divider-color);
}
.action-button.small {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 991px) {
    .profile-card {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .settings-header h1 { font-size: 2rem; }
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .switch, .action-button.small {
        align-self: flex-end;
    }
}

/* =================================
   CUSTOM MODAL (POPUP) STYLES
   ================================= */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.custom-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.custom-modal {
    background: var(--background-white);
    padding: 1.5rem 2rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-medium);
    width: 100%;
    max-width: 450px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.custom-modal-overlay.visible .custom-modal {
    transform: scale(1);
}
.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.modal-header h2 {
    color: var(--primary-dark);
    font-size: 1.5rem;
    margin: 0;
}
.modal-input-group {
    position: relative;
    margin-bottom: 1.25rem;
}
.modal-input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter);
}
.modal-input-group .password-toggle {
    right: 1rem;
    left: auto;
    cursor: pointer;
}
.modal-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    font-size: 1rem;
}
.modal-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-extra-light);
}
.strength-meter {
    height: 5px;
    background: var(--hover-gray);
    border-radius: 5px;
    margin-top: -10px;
    margin-bottom: 15px;
}
.strength-meter-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease, background-color 0.3s ease;
}
.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}
.modal-error-message {
    color: var(--error-red);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 1rem;
    display: none; /* Hidden by default */
}