/* css/settings.css */

.settings-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
   
}

.settings-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;

    transition: left 0.5s ease;
}



.settings-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow), var(--glow);
}

.settings-section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.setting-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.setting-item label {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select .select-selected {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-select .select-selected:after {
    content: '\f078'; /* Font Awesome chevron-down icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.custom-select .select-selected.select-arrow-active:after {
    transform: rotate(180deg);
}

.custom-select .select-items {
    position: absolute;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999; /* Ensure it's above other content */
    max-height: 200px; /* Limit height for scrollability */
    overflow-y: auto; /* Enable vertical scrolling */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: var(--shadow);
}

.custom-select .select-items.select-hide {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

.custom-select .select-items:not(.select-hide) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select .select-items div {
    padding: 12px 20px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.custom-select .select-items div:hover, .same-as-selected {
    background-color: var(--accent);
    color: white;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .custom-select .select-selected,
    .custom-select .select-items div {
        padding: 16px 20px;
        font-size: 1.1rem;
    }

    .custom-select .select-selected:after {
        font-size: 1rem;
    }
}

.setting-item input[type="file"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    appearance: none; /* Remove default select arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-item input:not([type="file"]):not([type="checkbox"]):not([type="radio"]) {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s ease;
}

.setting-item input[type="file"]:focus,
.setting-item input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Sync status styles */
.sync-status {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-indicator {
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.sync-text {
    font-size: 0.9rem;
}

/* Account section specific styles */
.account-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-top: 5px;
}

.error-message {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 10px;
    display: block;
}

.success-message {
    color: #22c55e;
    font-size: 0.9rem;
    margin-top: 10px;
    display: block;
}

.input-field {
    margin-bottom: 15px;
}

.input-field input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Specific styles for Account section layout */
.card.settings-section .setting-item {
    margin-bottom: 20px; /* Space below email display */
}

.card.settings-section .card {
    margin-top: 20px; /* Space above nested password card */
}

.setting-item .btn {
    width: auto; /* Allow buttons to size naturally */
    margin-top: 10px; /* Space from select/input */
    align-self: flex-start; /* Align buttons to the start of the flex container */
}

.data-management-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.data-management-buttons .btn {
    flex-grow: 1;
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .settings-section {
        padding: 20px;
    }

    .settings-section h2 {
        font-size: 1.5rem;
    }

    .setting-item label {
        font-size: 1rem;
    }

    .setting-item input[type="file"] {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .data-management-buttons {
        flex-direction: column;
    }

    .data-management-buttons .btn {
        width: 100%;
    }
}

/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    position: relative;
}

.modal-overlay.visible .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
}

.modal-body p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

    .modal-footer .btn {
        padding: 10px 20px;
        font-size: 1rem;
    }

/* Styles for the reset options buttons within the modal */
.reset-options {
    display: flex;
    gap: 10px; /* Space between buttons */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: center; /* Center buttons if they wrap */
    margin-top: 15px; /* Space from the message above */
}

.reset-options .btn {
    flex: 1; /* Allow buttons to grow and take equal space */
    min-width: 150px; /* Ensure buttons don't get too small */
    padding: 12px 20px; /* Adjust padding for better appearance */
    font-size: 1rem; /* Consistent font size */
}

/* Responsive adjustment for reset-options buttons */
@media (max-width: 480px) {
    .reset-options {
        flex-direction: column; /* Stack buttons vertically on small screens */
    }
}

/* Styles for the restore options buttons within the modal */
.restore-options {
    display: flex;
    gap: 10px; /* Space between buttons */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: center; /* Center buttons if they wrap */
    margin-top: 15px; /* Space from the message above */
}

.restore-options .btn {
    flex: 1; /* Allow buttons to grow and take equal space */
    min-width: 150px; /* Ensure buttons don't get too small */
    padding: 12px 20px; /* Adjust padding for better appearance */
    font-size: 1rem; /* Consistent font size */
}

/* Responsive adjustment for restore-options buttons */
@media (max-width: 480px) {
    .restore-options {
        flex-direction: column; /* Stack buttons vertically on small screens */
    }
}

/* Responsive adjustments for modal */
@media (max-width: 480px) {
    .modal {
        padding: 20px;
        width: 95%;
    }


    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Theme Toggle Button */
.theme-toggle-button {
    display: flex;
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle-button div {
    flex: 1;
    padding: 14px 20px;
    text-align: center;
    font-size: 1rem;
 
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.theme-toggle-left {
    background: white;
}
.theme-toggle-left:hover {
    background: rgb(233, 231, 238);
}
.theme-toggle-right {
    background: var(--accent);
}
.theme-toggle-right:hover {
    background: var(--accent-glow)
;
}

.settings-section a {
    color: var(--accent);
}
