/**
 * FGC Train Arrivals - Voice Announcements Styles
 * Styling for voice announcement controls and modal
 */

/* ============================================================================
   VOICE BUTTON IN HEADER
   ============================================================================ */

.voice-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.voice-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

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

.voice-btn.active {
    background: rgba(160, 216, 19, 0.25);
    border-color: rgba(160, 216, 19, 0.6);
    animation: voice-pulse 2s ease-in-out infinite;
}

.voice-btn .icon {
    font-size: 22px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.voice-btn:hover .icon {
    transform: scale(1.1);
}

@keyframes voice-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(160, 216, 19, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(160, 216, 19, 0);
    }
}

/* ============================================================================
   VOICE MODAL OVERLAY
   ============================================================================ */

.voice-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================================================
   VOICE MODAL CONTENT
   ============================================================================ */

.voice-modal-content {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
    border-radius: 24px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.voice-modal-content.open {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Dark mode support */
body.dark-mode .voice-modal-content {
    background: linear-gradient(135deg, #1E1E1E 0%, #2A2A2A 100%);
    color: #E8E8E8;
}

/* ============================================================================
   MODAL HEADER
   ============================================================================ */

.voice-modal-header {
    background: linear-gradient(135deg, #88BB0B 0%, #6A9308 100%);
    color: white;
    padding: 24px 32px;
    border-radius: 24px 24px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.voice-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-title-icon {
    font-size: 28px;
    animation: voice-icon-pulse 2s ease-in-out infinite;
}

@keyframes voice-icon-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.voice-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    line-height: 1;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============================================================================
   MODAL BODY
   ============================================================================ */

.voice-modal-body {
    padding: 32px;
}

/* Voice Status */
.voice-status {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(136, 187, 11, 0.1);
    border-radius: 12px;
    border: 2px solid rgba(136, 187, 11, 0.2);
}

.voice-support-check {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.status-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

.status-icon.success {
    background: #4CAF50;
    color: white;
}

.status-icon.error {
    background: #F44336;
    color: white;
}

body.dark-mode .voice-status {
    background: rgba(136, 187, 11, 0.15);
    border-color: rgba(136, 187, 11, 0.3);
}

/* ============================================================================
   CONTROL GROUPS
   ============================================================================ */

.voice-control-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.voice-control-group:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

body.dark-mode .voice-control-group {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   MAIN TOGGLE
   ============================================================================ */

.voice-toggle-label {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    padding: 20px;
    background: linear-gradient(135deg, #F8F9FA 0%, #FFFFFF 100%);
    border-radius: 16px;
    border: 2px solid rgba(136, 187, 11, 0.2);
    transition: all 0.3s ease;
}

.voice-toggle-label:hover {
    border-color: rgba(136, 187, 11, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

body.dark-mode .voice-toggle-label {
    background: linear-gradient(135deg, #2A2A2A 0%, #1E1E1E 100%);
    border-color: rgba(136, 187, 11, 0.3);
}

.voice-toggle-input {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 60px;
    height: 32px;
    background: #CCC;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.voice-toggle-input::before {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.voice-toggle-input:checked {
    background: #88BB0B;
}

.voice-toggle-input:checked::before {
    transform: translateX(28px);
}

.voice-toggle-slider {
    display: none;
}

.voice-toggle-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
}

.toggle-description {
    font-size: 14px;
    color: #666;
}

body.dark-mode .toggle-title {
    color: #E8E8E8;
}

body.dark-mode .toggle-description {
    color: #999;
}

/* ============================================================================
   SETTINGS PANEL
   ============================================================================ */

.voice-settings-panel {
    animation: slideDown 0.3s ease;
}

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

.settings-subtitle {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #1A1A1A;
}

body.dark-mode .settings-subtitle {
    color: #E8E8E8;
}

/* ============================================================================
   LABELS
   ============================================================================ */

.voice-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 12px;
}

body.dark-mode .voice-label {
    color: #E8E8E8;
}

/* ============================================================================
   VOLUME CONTROL
   ============================================================================ */

.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(136, 187, 11, 0.05);
    border-radius: 12px;
}

.volume-icon {
    font-size: 20px;
    opacity: 0.7;
}

.voice-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: rgba(136, 187, 11, 0.2);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.voice-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #88BB0B;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.voice-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.voice-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #88BB0B;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.voice-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.volume-value {
    min-width: 45px;
    text-align: right;
    font-weight: 700;
    color: #88BB0B;
}

body.dark-mode .volume-slider-container {
    background: rgba(136, 187, 11, 0.1);
}

/* ============================================================================
   VOICE SELECTION
   ============================================================================ */

.voice-select {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 2px solid rgba(136, 187, 11, 0.3);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: #1A1A1A;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-select:hover {
    border-color: rgba(136, 187, 11, 0.5);
}

.voice-select:focus {
    outline: none;
    border-color: #88BB0B;
    box-shadow: 0 0 0 4px rgba(136, 187, 11, 0.1);
}

body.dark-mode .voice-select {
    background: #2A2A2A;
    color: #E8E8E8;
    border-color: rgba(136, 187, 11, 0.4);
}

/* ============================================================================
   CHECKBOX LABELS
   ============================================================================ */

.voice-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(136, 187, 11, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.voice-checkbox-label:last-child {
    margin-bottom: 0;
}

.voice-checkbox-label:hover {
    background: rgba(136, 187, 11, 0.08);
    transform: translateX(4px);
}

body.dark-mode .voice-checkbox-label {
    background: rgba(136, 187, 11, 0.08);
}

body.dark-mode .voice-checkbox-label:hover {
    background: rgba(136, 187, 11, 0.15);
}

.voice-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid #88BB0B;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.voice-checkbox:checked {
    background: #88BB0B;
}

.voice-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.checkbox-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
}

.checkbox-description {
    font-size: 13px;
    color: #666;
}

body.dark-mode .checkbox-title {
    color: #E8E8E8;
}

body.dark-mode .checkbox-description {
    color: #999;
}

/* ============================================================================
   TEST BUTTON
   ============================================================================ */

.voice-test-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #88BB0B 0%, #6A9308 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(136, 187, 11, 0.3);
}

.voice-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(136, 187, 11, 0.4);
}

.voice-test-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(136, 187, 11, 0.3);
}

.test-icon {
    font-size: 20px;
}

/* ============================================================================
   HELP SECTION
   ============================================================================ */

.voice-help {
    background: rgba(136, 187, 11, 0.05);
    border-left: 4px solid #88BB0B;
    border-radius: 8px;
    padding: 20px;
    margin-top: 24px;
}

.help-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #1A1A1A;
}

.help-list {
    margin: 0;
    padding-left: 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.8;
}

.help-list li {
    margin-bottom: 8px;
}

.help-list li:last-child {
    margin-bottom: 0;
}

.help-list kbd {
    background: #F0F0F0;
    border: 1px solid #CCC;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: bold;
}

body.dark-mode .voice-help {
    background: rgba(136, 187, 11, 0.1);
}

body.dark-mode .help-title {
    color: #E8E8E8;
}

body.dark-mode .help-list {
    color: #999;
}

body.dark-mode .help-list kbd {
    background: #3A3A3A;
    border-color: #555;
    color: #E8E8E8;
}

/* ============================================================================
   MOBILE NOTE
   ============================================================================ */

.voice-mobile-note {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.note-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.voice-mobile-note p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

body.dark-mode .voice-mobile-note {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
}

body.dark-mode .voice-mobile-note p {
    color: #999;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .voice-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .voice-modal-header {
        border-radius: 0;
        padding: 20px 24px;
    }

    .voice-modal-title {
        font-size: 20px;
    }

    .voice-modal-body {
        padding: 24px;
    }

    .voice-toggle-label {
        padding: 16px;
    }

    .voice-toggle-input {
        width: 52px;
        height: 28px;
    }

    .voice-toggle-input::before {
        width: 24px;
        height: 24px;
    }

    .voice-toggle-input:checked::before {
        transform: translateX(24px);
    }

    .voice-control-group {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .voice-modal-overlay {
        padding: 0;
    }

    .voice-modal-header {
        padding: 16px 20px;
    }

    .voice-modal-title {
        font-size: 18px;
    }

    .voice-title-icon {
        font-size: 24px;
    }

    .voice-modal-body {
        padding: 20px;
    }

    .toggle-title {
        font-size: 15px;
    }

    .toggle-description {
        font-size: 13px;
    }

    .checkbox-title {
        font-size: 14px;
    }

    .checkbox-description {
        font-size: 12px;
    }

    .help-list {
        font-size: 13px;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus styles */
.voice-btn:focus-visible,
.voice-modal-close:focus-visible,
.voice-toggle-input:focus-visible,
.voice-slider:focus-visible,
.voice-select:focus-visible,
.voice-checkbox:focus-visible,
.voice-test-btn:focus-visible {
    outline: 3px solid #88BB0B;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .voice-btn,
    .voice-toggle-label,
    .voice-checkbox-label {
        border-width: 3px;
    }

    .voice-toggle-input,
    .voice-checkbox {
        border-width: 3px;
    }
}
