/* Settings Container Styles */
.settings-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 400px;
    max-height: 80vh;
    background-color: var(--send-text);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    color: var(--text-color);
    opacity: 0;
    visibility: hidden;
    width: 34rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.settings-container::-webkit-scrollbar {
    width: 6px;
}

.settings-container::-webkit-scrollbar-track {
    background: transparent;
}

.settings-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 6px;
}

.settings-container.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    animation: settingsPulse 0.5s ease-out;
}

@keyframes settingsPulse {
    0% {
        box-shadow: 0 0 0 rgba(79, 172, 254, 0);
    }
    50% {
        box-shadow: 0 0 25px rgba(79, 172, 254, 0.5);
    }
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.settings-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.settings-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #aaaaaa;
    letter-spacing: -0.5px;
}

.close-settings {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-settings:hover {
    color: var(--primary-color);
    background-color: var(--hover-color);
    transform: rotate(90deg);
}

/* Tabs Styling */
.settings-tabs {
    display: flex;
    background: var(--bg-secondary);
    margin-bottom: 20px;
    justify-content: center;
    align-items: center;
    padding: 0.2rem 0.2rem;
    width: 100%;
    border-radius: 14px;
    gap: 45px;
}

.tab {
    padding: 4px 14px;
    background: transparent;
    width: 8rem;
    height: 2.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.tab:hover {
    color: var(--primary-color);
    background: #5e6063;
    transition: all 0.2s ease;
}

.tab.active {
    background: #5e6063;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tab Content */
.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Settings Sections */
.settings-section {
    margin-bottom: 30px;
    padding-bottom: 5px;
}

.settings-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-color);
    display: inline-block;
    position: relative;
    padding-bottom: 5px;
}

.settings-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.settings-section:hover h3::after {
    width: 100%;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.theme-option:hover {
    background-color: var(--theme-active);
    transform: translateY(-3px);
}

.theme-preview {
    width: 90px;
    height: 60px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.theme-preview.dark {
    background-color: #121212;
    border: 1px solid #333;
    background-image: linear-gradient(to bottom right, #121212, #2a2a2a);
}

.theme-preview.light {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    background-image: linear-gradient(to bottom right, #f5f5f5, #e0e0e0);
}

.theme-option.active {
    background-color: var(--theme-active);
}

.theme-option.active .theme-preview {
    border-color: var(--primary-color);
    box-shadow: 0 6px 12px rgba(79, 172, 254, 0.3);
    transform: scale(1.05);
}

.theme-option span {
    font-weight: 500;
    transition: color 0.3s ease;
}

.theme-option.active span {
    color: var(--primary-color);
}

/* Voice Selector */
.voice-selector {
    margin-top: 15px;
}

.voice-selector h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-color);
    opacity: 0.8;
}

.voice-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.voice-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
    width: 90px;
}

.voice-option:hover {
    background-color: var(--theme-active);
    transform: translateY(-3px);
}

/* Voice Selection Overlay */
.voice-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.voice-selection-overlay.open {
    opacity: 1;
    visibility: visible;
}

.voice-selection-container {
    width: 400px;
    background-color: var(--sidebar-bg);
    background-image: linear-gradient(to bottom, var(--sidebar-bg), var(--bg-color));
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 20px;
    color: var(--text-color);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.voice-selection-overlay.open .voice-selection-container {
    transform: scale(1);
    animation: voicePulse 0.5s ease-out;
}

@keyframes voicePulse {
    0% {
        box-shadow: 0 0 0 rgba(79, 172, 254, 0);
    }
    50% {
        box-shadow: 0 0 25px rgba(79, 172, 254, 0.5);
    }
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
}

.voice-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.voice-selection-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.voice-selection-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #aaaaaa;
    letter-spacing: -0.5px;
}

.close-voice-selection {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-voice-selection:hover {
    color: var(--primary-color);
    background-color: var(--hover-color);
    transform: rotate(90deg);
}

/* Toggle Switch Styles */
.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.toggle-container:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    z-index: -1;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #0084ff8e;
    transition: .4s;
    border-radius: 24px;
    z-index: 1;
}

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

input:checked + .toggle-slider {
    background-color: #0099ff;
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--primary-color);
}

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

/* Advanced Voice Settings */
.voice-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
}

.voice-blob-container {
    width: 150px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-secondary);
    border-radius: 50%;
    margin-bottom: 10px;
}

.voice-blob {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    animation: pulse 2s infinite ease-in-out;
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.5);
    position: relative;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.voice-blob.loading::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    border-bottom-color: var(--secondary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(79, 172, 254, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0);
    }
}

.voice-controls {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 15px;
    align-items: center;
}

.voice-dropdown {
    width: 80%;
    padding: 10px 15px;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    outline: none;
    transition: all 0.3s ease;
}

.voice-dropdown:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 172, 254, 0.3);
}

#select-voice-btn, #voice-done-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    background: var(--send-msg);
    color: var(--send-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

#select-voice-btn {
    margin-left: 0;
    width: 25%;
    max-width: 200px;
}

#select-voice-btn:hover, #voice-done-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.voice-options p{
    background: blue;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
}
.voice-success-message {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: black;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.3s ease-out forwards;
    z-index: 10;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.voice-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.voice-preview::before {
    content: '\f130'; /* Microphone icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 16px;
    color: var(--text-color);
}

.voice-option.active {
    background-color: var(--theme-active);
}

.voice-option.active .voice-preview {
    border-color: var(--primary-color);
    box-shadow: 0 6px 12px rgba(79, 172, 254, 0.3);
}

.voice-option.active .voice-preview::before {
    color: var(--primary-color);
}

.voice-option span {
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    transition: color 0.3s ease;
}

.voice-option.active span {
    color: var(--primary-color);
}

/* Language Selector */
.language-selector, .model-selector {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--primary-color) 50%),
                      linear-gradient(135deg, var(--primary-color) 50%, transparent 50%);
    background-position: calc(100% - 20px) center, calc(100% - 15px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.model-selector-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.model-description {
    font-size: 13px;
    padding: 10px;
    border-radius: 5px;
    background-color: rgba(var(--bg-secondary-rgb), 0.5);
    border: 1px solid var(--border-color);
}

.language-selector:hover, .language-selector:focus {
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(79, 172, 254, 0.2);
    outline: none;
}

.language-selector option {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 10px;
}

/* Profile Info */
.profile-info {
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}


.profile-field {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 10px;
}

.profile-field:last-child {
    margin-bottom: 0;
}


.profile-field label {
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-value {
    font-weight: 500;
    font-size: 1.05rem;
    transition: color 0.2s ease;
}

.profile-field:hover .profile-value {
    color: var(--primary-color);
}

/* Buttons */
.settings-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 10px;
    width: 100%;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-button:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.settings-button.danger {
    color: #ff5555;
    border-color: rgba(255, 85, 85, 0.3);
}

.settings-button.danger:hover {
    background-color: rgba(255, 85, 85, 0.1);
    border-color: rgba(255, 85, 85, 0.5);
}


.settings-button:hover {
    background-color: var(--hover-color);
}

.settings-button.danger {
    color: #ff5555;
    border-color: rgba(255, 85, 85, 0.3);
}

.settings-button.danger:hover {
    background-color: rgba(255, 85, 85, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .settings-container {
        width: 90%;
        max-width: 400px;
        max-height: 85vh;
    }
    
    .settings-tabs {
        gap: 15px;
    }
    
    .tab {
        width: auto;
        padding: 4px 10px;
        font-size: 0.9rem;
    }
    
    .theme-selector {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .theme-preview {
        width: 70px;
        height: 50px;
    }
    
    .settings-button {
        padding: 8px 12px;
    }
    
    .profile-field {
        margin-bottom: 15px;
    }
    
    .profile-value {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .settings-container {
        width: 95%;
        padding: 15px;
    }
    
    .settings-tabs {
        gap: 5px;
    }
    
    .tab {
        padding: 4px 8px;
        font-size: 0.85rem;
        height: 2.2rem;
    }
    
    .settings-header h2 {
        font-size: 1.4rem;
    }
    
    .settings-section h3 {
        font-size: 1rem;
    }
}