/* Settings Tab System Styles */
.settings-tab-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
}

.settings-tab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7b1fa2, #4a148c);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(123, 31, 162, 0.4);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(123, 31, 162, 0.6);
    background: linear-gradient(135deg, #8e24aa, #512da8);
}

.settings-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    border-radius: 50%;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.settings-badge.active {
    transform: scale(1);
}

.settings-panel {
    position: fixed;
    top: 50%;
    right: -380px;
    transform: translateY(-50%);
    width: 350px;
    max-height: 80vh;
    background: rgba(20, 20, 40, 0.95);
    border: 1px solid rgba(123, 31, 162, 0.5);
    border-radius: 15px;
    backdrop-filter: blur(15px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    z-index: 9998;
}

.settings-panel.active {
    right: 20px;
    opacity: 1;
    visibility: visible;
}

.settings-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(123, 31, 162, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 30, 60, 0.5);
}

.settings-header h3 {
    margin: 0;
    color: #c994ff;
    font-size: 1.2rem;
}

.settings-close {
    background: none;
    border: none;
    color: #c994ff;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.settings-close:hover {
    background: rgba(123, 31, 162, 0.3);
}

.settings-content {
    padding: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(123, 31, 162, 0.2);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h4 {
    color: #9c27b0;
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.settings-toggle span {
    color: #e8e8e8;
    font-size: 0.9rem;
}

/* Toggle Switch Styles */
.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: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #7b1fa2;
}

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

/* Voice Settings Container */
.voice-settings-container,
.voice-input-container {
    background: rgba(30, 30, 60, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.voice-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}

.voice-controls-row label {
    color: #c994ff;
    font-size: 0.9rem;
    min-width: 80px;
}

.voice-controls-row input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.voice-controls-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #7b1fa2;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(123, 31, 162, 0.5);
}

.voice-controls-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #7b1fa2;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(123, 31, 162, 0.5);
}

.voice-controls-row span {
    color: #a0a0a0;
    font-size: 0.8rem;
    min-width: 40px;
    text-align: right;
}

.voice-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.voice-action-btn {
    background: rgba(123, 31, 162, 0.6);
    border: 1px solid rgba(123, 31, 162, 0.8);
    color: #e8e8e8;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.voice-action-btn:hover {
    background: rgba(123, 31, 162, 0.8);
    transform: translateY(-1px);
}

.voice-action-btn:active {
    transform: translateY(0);
}

.mic-status {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: #a0a0a0;
    background: rgba(20, 20, 40, 0.5);
    border-radius: 6px;
    margin: 0.5rem 0;
}

.mic-status.active {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.mic-status.error {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .settings-tab-container {
        bottom: 20px;
        right: 15px;
    }
    
    .settings-panel {
        width: 300px;
        max-height: 70vh;
    }
    
    .voice-actions {
        flex-direction: column;
    }
    
    .voice-action-btn {
        flex: none;
    }
}

@media (max-width: 480px) {
    .settings-panel {
        width: calc(100vw - 30px);
        right: -15px;
    }
    
    .voice-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .voice-controls-row label {
        min-width: auto;
    }
    
    .voice-controls-row span {
        text-align: center;
    }
}

/* Animation for settings visibility */
.settings-hidden {
    opacity: 0.5;
    pointer-events: none;
}

.settings-disabled .voice-settings-container,
.settings-disabled .voice-input-container {
    opacity: 0.5;
    pointer-events: none;
}

/* Focus mode styles */
.focus-mode .settings-panel {
    background: rgba(10, 10, 20, 0.98);
}

.focus-mode .cosmic-background,
.focus-mode .shooting-star {
    display: none !important;
}

/* High contrast mode */
.high-contrast .settings-panel {
    background: #000;
    border-color: #fff;
    color: #fff;
}

.high-contrast .settings-header {
    background: #222;
    border-color: #fff;
}

.high-contrast .voice-settings-container,
.high-contrast .voice-input-container {
    background: #333;
}

.high-contrast .voice-action-btn {
    background: #444;
    border-color: #fff;
    color: #fff;
}