/* Custom styles for EyeHear TTS App */

body {
    background-color: var(--bs-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* No body padding needed since overlay is positioned near mic button */

/* Hide voice overlay by default */
.voice-recording-overlay.d-none {
    display: none !important;
}

/* Enhanced Logo and Branding */
.navbar-brand img {
    filter: drop-shadow(0 2px 4px rgba(74, 128, 245, 0.3));
    transition: transform 0.2s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-brand span {
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #4A80F5, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Trend Analysis Modal Styles */
.trend-tab-group .trend-tab {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: none;
    border-bottom: 1px solid #fff;
    background: transparent;
    transition: all 0.2s ease;
    border-radius: 0;
}

.trend-tab-group .btn-check:checked + .trend-tab {
    background-color: #000;
    border-bottom: 1px solid #fff;
    color: #fff;
    font-weight: 600;
}

.trend-guide-text {
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.75rem;
    margin-top: 0.5rem;
}

/* Trend input placeholder text size */
.trend-input-field .form-control::placeholder {
    font-size: 0.85rem;
    padding-top: 0.25rem;
}

.trend-analyze-btn {
    padding: 0.5rem 1.5rem;
}

.trend-btn-text {
    font-size: 0.875rem;
}

/* Analysis timeout toast */
.analysis-timeout-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #000;
    color: #fff;
    padding: 16px 32px;
    border-radius: 8px;
    z-index: 10000;
}

/* Floating speech generation toast */
.floating-speech-toast {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #4A80F5, #6366f1);
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    z-index: 9999;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(74, 128, 245, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: floatingBounce 2s ease-in-out infinite;
    opacity: 0;
    transition: all 0.3s ease;
}

.floating-speech-toast.show {
    opacity: 1;
    animation: floatingBounce 2s ease-in-out infinite;
}

.floating-speech-toast.hide {
    animation: slideDownOut 0.5s ease-in forwards;
}

/* Floating bounce animation */
@keyframes floatingBounce {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0px);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-10px);
    }
}

/* Slide down and out animation */
@keyframes slideDownOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(100px);
    }
}
    font-size: 0.9rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.analysis-timeout-toast.show {
    opacity: 1;
}

/* Text Input Clear Button */
.textarea-container {
    position: relative;
}

.clear-text-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.clear-text-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: scale(1.1);
}

.clear-text-btn:active {
    transform: scale(0.95);
}

/* Modern Audio Player */
.modern-player {
    background-color: var(--bs-secondary-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--bs-border-color);
}

.progress-bar-container {
    position: relative;
    height: 6px;
    background-color: var(--bs-border-color);
    border-radius: 3px;
    cursor: pointer;
}

.progress-track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4A80F5, #6366f1);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: #4A80F5;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    left: 0%;
    transition: left 0.1s ease;
    opacity: 0;
}

.progress-bar-container:hover .progress-thumb {
    opacity: 1;
}

.player-controls {
    gap: 1rem;
}

.player-btn {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: linear-gradient(135deg, #4A80F5, #6366f1, #8b5cf6);
    box-shadow: 0 8px 24px rgba(74, 128, 245, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.player-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.player-btn:hover::before {
    left: 100%;
}

.player-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(74, 128, 245, 0.6);
    background: linear-gradient(135deg, #5a90ff, #7376f1, #9b6cf6);
}

.player-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(74, 128, 245, 0.5);
}

.player-btn i {
    font-size: 1.2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 1;
    position: relative;
}

.sound-wave {
    height: 40px;
    align-items: end;
}

.wave-bar {
    width: 4px;
    height: 8px;
    border-radius: 2px;
    transition: height 0.3s ease;
}

.sound-wave.playing .wave-bar:nth-child(1) { animation: wave-animation 1.2s ease-in-out infinite 0.1s; }
.sound-wave.playing .wave-bar:nth-child(2) { animation: wave-animation 1.2s ease-in-out infinite 0.3s; }
.sound-wave.playing .wave-bar:nth-child(3) { animation: wave-animation 1.2s ease-in-out infinite 0.5s; }
.sound-wave.playing .wave-bar:nth-child(4) { animation: wave-animation 1.2s ease-in-out infinite 0.2s; }
.sound-wave.playing .wave-bar:nth-child(5) { animation: wave-animation 1.2s ease-in-out infinite 0.4s; }

@keyframes wave-animation {
    0%, 100% { height: 8px; }
    50% { height: 32px; }
}

/* Card hover effects */
.card {
    border: 1px solid var(--bs-border-color);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Custom range slider styling */
.form-range {
    height: 0.5rem;
}

.form-range::-webkit-slider-thumb {
    background: var(--bs-primary);
    border: 2px solid var(--bs-body-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-range::-moz-range-thumb {
    background: var(--bs-primary);
    border: 2px solid var(--bs-body-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Textarea character counter */
.form-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

#loadingIndicator .card-body {
    animation: pulse 2s infinite;
}

/* Audio player styling */
audio {
    border-radius: 0.375rem;
    background-color: var(--bs-secondary-bg);
}

/* Button hover effects */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Button states based on text input */
.btn-disabled-state {
    background-color: rgba(108, 117, 125, 0.3) !important;
    border-color: rgba(108, 117, 125, 0.3) !important;
    color: rgba(255, 255, 255, 0.4) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.btn-disabled-state:hover {
    transform: none !important;
    box-shadow: none !important;
    background-color: rgba(108, 117, 125, 0.3) !important;
    border-color: rgba(108, 117, 125, 0.3) !important;
}

/* Enhanced visibility for input buttons */
.input-btn-enhanced {
    opacity: 1 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.input-btn-enhanced:hover {
    color: rgba(255, 255, 255, 1) !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Features section */
.features-icon {
    color: var(--bs-primary);
    margin-bottom: 1rem;
}

/* Input buttons spacing adjustment */
.input-controls {
    margin-top: 0.75rem !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .modern-player {
        padding: 1rem;
    }
    
    .player-btn {
        width: 60px;
        height: 60px;
    }
    
    .sound-wave {
        height: 30px;
    }
    
    .player-controls {
        gap: 0.5rem;
    }
    
    .input-controls {
        margin-top: 1rem !important;
    }
    
    /* Mobile 2x2 grid layout */
    .action-buttons-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }
    
    .action-btn {
        font-size: 0.9rem !important;
        padding: 0.75rem 0.5rem !important;
        min-height: 48px !important;
    }
    
    .translate-dropdown-btn {
        min-width: 35px !important;
        padding: 0.75rem 0.4rem !important;
    }
}

/* Action Buttons Grid Layout */
.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.action-button-item {
    display: flex;
    flex-direction: column;
}

.action-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 1rem 0.5rem !important;
    min-height: 52px !important;
    font-weight: 600 !important;
    border-radius: 0.5rem !important;
    transition: all 0.3s ease !important;
    font-size: 1rem !important;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Translation button group styling */
.translate-main-btn {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.translate-dropdown-btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    min-width: 40px !important;
    padding: 1rem 0.6rem !important;
    border-left: 1px solid rgba(255,255,255,0.2) !important;
}

.translate-dropdown-btn::after {
    margin: 0;
}

/* Quiz Modal Styling */
.quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding-bottom: env(safe-area-inset-bottom);
}

.quiz-modal-content {
    background: var(--bs-dark);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--bs-border-color);
}

.quiz-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.quiz-modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.quiz-close-btn {
    background: none;
    border: none;
    color: var(--bs-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quiz-close-btn:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

.quiz-modal-body {
    padding: 1.5rem;
}

.quiz-instruction {
    margin-bottom: 0.75rem;
    color: var(--bs-body-color);
    font-size: 0.95rem;
    line-height: 1.4;
}

.quiz-example {
    margin-bottom: 1rem;
    color: var(--bs-secondary);
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bs-secondary-bg);
    border-radius: 6px;
    border-left: 3px solid var(--bs-warning);
}

.quiz-keyword-input {
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    resize: vertical;
    min-height: 80px;
}

.quiz-keyword-input:focus {
    border-color: var(--bs-warning);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-warning-rgb), 0.25);
}

.quiz-modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--bs-border-color);
}

.quiz-modal-footer .btn {
    min-width: 80px;
}

/* Toast Message Styling */
.toast-message {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease-out;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 80%;
    white-space: nowrap;
    pointer-events: none;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile adjustments for toast */
@media (max-width: 768px) {
    .toast-message {
        bottom: calc(2rem + env(safe-area-inset-bottom));
        max-width: 90%;
        font-size: 0.85rem;
        padding: 0.625rem 1rem;
    }
}

/* Analysis Loading Overlay */
.analysis-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
}

.analysis-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 2rem 2.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
}

.analysis-spinner {
    position: relative;
    width: 48px;
    height: 48px;
    margin-bottom: 1.5rem;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid #4A80F5;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: 0s;
    border-top-color: #4A80F5;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.4s;
    border-top-color: #60A5FA;
    transform: scale(0.8);
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.8s;
    border-top-color: #93C5FD;
    transform: scale(0.6);
}

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

.analysis-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Loading Card Styling */
.loading-card {
    background-color: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.loading-card-body {
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.analysis-spinner-small {
    position: relative;
    width: 30px;
    height: 30px;
    margin-bottom: 1rem;
}

.analysis-spinner-small .spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid #4A80F5;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.analysis-spinner-small .spinner-ring:nth-child(1) {
    animation-delay: 0s;
    border-top-color: #4A80F5;
}

.analysis-spinner-small .spinner-ring:nth-child(2) {
    animation-delay: -0.4s;
    border-top-color: #60A5FA;
    transform: scale(0.8);
}

.analysis-spinner-small .spinner-ring:nth-child(3) {
    animation-delay: -0.8s;
    border-top-color: #93C5FD;
    transform: scale(0.6);
}

.loading-text {
    color: var(--bs-body-color);
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Recording animation for voice overlay (not dropdown item) */
@keyframes pulse-recording {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Voice Recording Bottom Fixed Overlay - Redesigned */
.voice-recording-overlay {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 120px !important; /* Reduced height to avoid plus button conflict */
    background: linear-gradient(135deg, rgba(16, 20, 30, 0.98), rgba(25, 35, 50, 0.98)) !important;
    backdrop-filter: blur(20px) !important;
    border-top-left-radius: 25px !important;
    border-top-right-radius: 25px !important;
    border: 1px solid rgba(108, 117, 125, 0.4) !important;
    border-bottom: none !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4) !important;
    z-index: 99999 !important;
    display: block !important; /* Changed from flex to avoid layout conflicts */
    pointer-events: none !important;
    transform: translateY(100%) !important;
    transition: transform 0.4s ease-out !important;
}

/* Show voice overlay when not hidden */
.voice-recording-overlay:not(.d-none) {
    transform: translateY(0) !important;
    pointer-events: all !important;
}

.voice-recording-compact {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important; /* Changed from flex to block to avoid centering conflicts */
}

.voice-mic-container {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 120px !important;
    height: 120px !important;
    display: block !important; /* Changed to block to avoid flex layout issues */
    z-index: 1 !important; /* Ensure it's below the stop button */
}

.voice-circle {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 60px !important;
    height: 60px !important;
    background: linear-gradient(135deg, var(--bs-info), #17a2b8) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 24px rgba(23, 162, 184, 0.5) !important;
    z-index: 2 !important;
    animation: voice-pulse-idle 2s infinite ease-in-out;
}

.voice-circle svg {
    color: white;
}

.voice-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(23, 162, 184, 0.3);
    border-radius: 50%;
    animation: voice-wave-idle 2s infinite ease-out;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.wave-1 {
    width: 70px !important;
    height: 70px !important;
    animation-delay: 0s;
}

.wave-2 {
    width: 80px !important;
    height: 80px !important;
    animation-delay: 0.2s;
}

.wave-3 {
    width: 90px !important;
    height: 90px !important;
    animation-delay: 0.4s;
}

.wave-4 {
    width: 100px !important;
    height: 100px !important;
    animation-delay: 0.6s;
}

@keyframes voice-wave-animation {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Voice recording idle animation - subtle waves */
.voice-recording-overlay.listening .voice-wave {
    animation: voice-wave-idle 3s infinite ease-out;
    opacity: 0.4;
    border-width: 1px;
    border-color: rgba(23, 162, 184, 0.3);
}

.voice-recording-overlay.listening .voice-circle {
    animation: voice-pulse-idle 2s infinite ease-in-out;
}

/* Voice recording with sound detected - active waves */
.voice-recording-overlay.sound-detected .voice-wave {
    animation: voice-wave-active 1s infinite ease-out;
    opacity: 1;
    border-width: 2px;
    border-color: rgba(23, 162, 184, 0.8);
}

.voice-recording-overlay.sound-detected .voice-circle {
    animation: voice-pulse-active 1s infinite ease-in-out;
}

/* Idle animations */
@keyframes voice-wave-idle {
    0% {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(0.95);
    }
    50% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

@keyframes voice-pulse-idle {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 8px 32px rgba(23, 162, 184, 0.2);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 12px 36px rgba(23, 162, 184, 0.4);
    }
}

/* Active animations */
@keyframes voice-wave-active {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.4);
    }
}

@keyframes voice-pulse-active {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 8px 32px rgba(23, 162, 184, 0.6);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 20px 60px rgba(23, 162, 184, 1);
    }
}

@keyframes voice-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 8px 32px rgba(23, 162, 184, 0.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 12px 40px rgba(23, 162, 184, 0.8);
    }
}

/* Dropdown menu styling consistency */
.dropdown-menu {
    background-color: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

.dropdown-item {
    color: var(--bs-body-color) !important;
    background-color: transparent !important;
    padding: 0.75rem 1rem;
    margin: 0;
    transition: all 0.15s ease-in-out;
    border: none !important;
    line-height: 1.2;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bs-info) !important;
    color: var(--bs-white) !important;
}

.dropdown-item:active {
    background-color: var(--bs-info) !important;
    color: var(--bs-white) !important;
}

/* Voice compatibility notice styling */
.voice-compatibility-notice {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-warning);
    color: var(--bs-dark);
    border: 1px solid var(--bs-warning-border-subtle);
}

.voice-compatibility-notice strong {
    font-weight: 600;
}

.voice-compatibility-notice small {
    line-height: 1.4;
}

/* Microphone Icon Button */
.mic-icon-btn {
    background: none;
    border: none;
    color: var(--bs-secondary);
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.mic-icon-btn:hover {
    background: rgba(108, 117, 125, 0.1);
    color: var(--bs-info);
    transform: scale(1.1);
}

.mic-icon-btn:active {
    background: rgba(108, 117, 125, 0.2);
    transform: scale(0.95);
}

.mic-icon-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.3);
}

/* Plus button gentle pulsing animation */
#dropdownMenuButton {
    animation: gentle-pulse 3s ease-in-out infinite;
}

#dropdownMenuButton::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: ripple-pulse 4s ease-in-out infinite;
    z-index: -1;
}

@keyframes gentle-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes ripple-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.1;
    }
}

/* Enhanced hover effect for plus button */
#dropdownMenuButton:hover {
    animation: none; /* Stop pulse on hover */
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Remove dropdown arrow */
.mic-icon-btn::after,
.mic-icon-btn.dropdown-toggle::after {
    display: none !important;
}

/* Dropdown menu item disabled state */
.dropdown-item.disabled {
    color: var(--bs-secondary);
    opacity: 0.6;
    pointer-events: none;
}

/* Camera Overlay - Full screen with mobile browser support */
.camera-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.camera-fullscreen-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.camera-video-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); /* Increased space + safe area */
    padding: 20px; /* Add padding to prevent video overlap with controls */
    min-height: 0; /* Allow flex shrinking */
}

.camera-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.camera-status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 1000;
}

.camera-bottom-controls {
    position: absolute;
    bottom: max(40px, env(safe-area-inset-bottom, 20px)); /* Respect safe areas */
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    z-index: 1000;
    height: 60px; /* Fixed height for control area */
    padding-bottom: env(safe-area-inset-bottom, 0px); /* Additional padding for safe area */
}

/* Camera close button */
.camera-close-btn {
    position: absolute;
    left: 50px;
    background: rgba(108, 117, 125, 0.2);
    border: 1px solid rgba(108, 117, 125, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.camera-close-btn:hover {
    background: rgba(23, 162, 184, 0.3);
    border-color: rgba(23, 162, 184, 0.5);
    color: var(--bs-white);
    transform: scale(1.05);
}

/* Camera capture button - main button */
.camera-capture-btn {
    background: rgba(23, 162, 184, 0.3);
    border: 2px solid rgba(23, 162, 184, 0.5);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-white);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.camera-capture-btn:hover {
    background: rgba(23, 162, 184, 0.5);
    border-color: rgba(23, 162, 184, 0.8);
    transform: scale(1.05);
}

/* Camera switch button */
.camera-switch-btn {
    position: absolute;
    right: 50px;
    background: rgba(108, 117, 125, 0.2);
    border: 1px solid rgba(108, 117, 125, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: var(--bs-light);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
}

.camera-switch-btn:hover {
    background: rgba(23, 162, 184, 0.3);
    border-color: rgba(23, 162, 184, 0.5);
    color: var(--bs-white);
    transform: scale(1.05);
}

/* Button text size adjustment */
.btn-lg {
    font-size: 0.9rem !important;
    padding: 0.5rem 1rem !important;
}

/* Streaming Toast Animation */
.streaming-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #4A80F5, #6366f1);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(74, 128, 245, 0.4);
    backdrop-filter: blur(10px);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.streaming-toast.show {
    opacity: 1;
}

.bounce-animation {
    animation: streamingBounce 0.6s ease-out;
}

@keyframes streamingBounce {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Main content wrapper for better centering on desktop */
.main-content-wrapper {
    min-height: calc(100vh - 100px);
    min-height: calc(100dvh - 100px); /* Dynamic viewport height for mobile browsers */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 1rem)); /* Safe area for mobile */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content-wrapper {
        min-height: auto;
        padding: 1rem 0;
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 0.5rem)); /* Safe area for mobile */
        justify-content: flex-start;
    }
    
    /* Show navigation on mobile */
    .navbar {
        display: block !important;
    }
}

/* Hide navigation on desktop since logo is in main content */
@media (min-width: 769px) {
    .navbar {
        display: none;
    }
}

/* Custom textarea placeholder styling */
.custom-textarea {
    padding-top: 0.8rem;
}

.custom-textarea::placeholder {
    font-size: 0.85rem;
    color: var(--bs-secondary);
    opacity: 0.8;
}

/* Removed old voice close button - now using compact design */

/* Voice Recording Close Button */
.voice-close-compact-btn {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    background: rgba(220, 53, 69, 0.2) !important;
    border: 1px solid rgba(220, 53, 69, 0.4) !important;
    border-radius: 8px !important; /* Square with rounded corners for stop icon */
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #dc3545 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 100000 !important;
}

.voice-close-compact-btn:hover {
    background: rgba(220, 53, 69, 0.3) !important;
    border-color: rgba(220, 53, 69, 0.6) !important;
    color: #fff !important;
    transform: scale(1.05) !important;
}

/* Slide up animation */
@keyframes slideUpFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 1.75rem;
    }
    
    .modern-player {
        padding: 0.75rem;
    }
    
    .player-btn {
        width: 55px;
        height: 55px;
    }
    
    .player-btn i {
        font-size: 1rem;
    }
}

/* Character count styling - subdued appearance */
#charCount {
    color: var(--bs-secondary);
    opacity: 0.6;
    font-size: 0.875rem;
}

/* Character count color coding */
#charCount.warning {
    color: var(--bs-warning);
    opacity: 0.8;
}

#charCount.danger {
    color: var(--bs-danger);
    opacity: 0.8;
}

/* Success/Error alert animations */
.alert {
    animation: slideIn 0.3s ease-out;
}

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

/* Custom button styles - removed custom Summarize button styling to use Bootstrap defaults */

/* Dark theme specific adjustments */
[data-bs-theme="dark"] {
    --bs-border-color: #495057;
}

[data-bs-theme="dark"] .navbar-brand {
    color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Dark theme file info overlay */
[data-bs-theme="dark"] .bg-white {
    background-color: var(--bs-dark) !important;
}

/* Player Overlay Styles */
.player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.player-overlay.active {
    opacity: 1;
    visibility: visible;
}

.player-container {
    background: #1E1E1E;
    border: none;
    border-radius: 0;
    padding: 2rem 1.5rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 1rem)); /* Safe area for mobile */
    width: 100%;
    max-width: 576px; /* Same as main page container */
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0 auto; /* Center the container */
}

/* Mobile Header */
.mobile-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; /* Changed from space-between to center */
    margin-bottom: 1rem !important;
    padding: 1rem 0 !important;
    order: 1 !important;
    position: relative !important;
}

.header-btn {
    width: 40px !important;
    height: 40px !important;
    border: none !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #9ca3af !important;
    font-size: 1.3rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.8 !important;
    padding: 0 !important;
    margin: 0 !important;
    position: absolute !important;
}

/* Position download button to the left */
.header-btn.download-btn {
    left: 0 !important;
}

/* Position close button to the right */
.header-btn.close-btn {
    right: 0 !important;
}

.header-btn svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    margin: 0 auto !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
}

.header-btn:hover {
    background: transparent;
    color: white;
    transform: scale(1.1);
    opacity: 1;
}

.header-title {
    flex: 1;
    text-align: center;
    margin: 0 1rem;
}

.player-title {
    color: #9ca3af;
    font-weight: 600;
    font-size: 1.1rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.sound-wave-section {
    order: 1;
    margin-bottom: 0.5rem;
}

.progress-section {
    margin: 0 0 0.075rem 0;
    order: 2;
}

.controls-section {
    order: 3;
    margin-bottom: 0.225rem;
}

.time-display {
    display: flex;
    justify-content: space-between;
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.progress-bar-container {
    height: 4px;
    background-color: #4b5563;
    border-radius: 2px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.progress-bar-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: transparent;
    outline: none;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
}

.progress-bar-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4A80F5;
    cursor: pointer;
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

.progress-bar-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4A80F5;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    position: relative;
    z-index: 2;
}

.progress-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #4A80F5;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.controls-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.control-center {
    order: 1;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    order: 2;
}

.control-left {
    text-align: left;
}

.control-center {
    text-align: center;
}

.control-right {
    text-align: right;
}

.speed-btn-new {
    font-size: 1rem;
    font-weight: 600;
    color: #9ca3af;
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    flex-shrink: 0;
    position: absolute;
    right: 0;
}

.speed-btn-new:hover {
    color: white;
}

.control-row-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    max-width: 300px;
    position: relative;
    margin-top: -0.5rem;
    margin-bottom: 2rem; /* Add bottom margin for space from browser bottom */
}

.control-left-space {
    position: absolute;
    left: 0;
    width: 80px;
    flex-shrink: 0;
}



#speedText {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Mobile Full Screen Styles */
@media (max-width: 768px) {
    .player-container {
        padding: 2rem 1.5rem;
    }
    
    .mobile-header {
        margin-bottom: 1rem;
        padding: 0.5rem 0;
    }
    
    .header-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .header-btn svg {
        width: 22px !important;
        height: 22px !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    .player-title {
        font-size: 1.2rem;
        max-width: 200px;
    }
    
    .sound-wave {
        height: 140px;
        gap: 8px;
    }
    
    .sound-wave .wave-bar {
        width: 8px;
        height: 20px;
    }
    
    .sound-wave .wave-bar:nth-child(3) {
        width: 10px;
    }
    
    .play-pause-btn {
        width: 90px;
        height: 90px;
        font-size: 2rem;
    }
    
    .speed-btn-new {
        font-size: 1rem;
        padding: 8px 16px;
    }
    
    .control-row-center {
        gap: 2rem;
        max-width: 280px;
        margin-bottom: 2.5rem; /* Add more bottom margin for mobile */
    }
}

@media (max-width: 480px) {
    .player-container {
        padding: 1.5rem 1rem;
    }
    
    .sound-wave {
        height: 120px;
        gap: 6px;
    }
    
    .sound-wave .wave-bar {
        width: 6px;
        height: 18px;
    }
    
    .sound-wave .wave-bar:nth-child(3) {
        width: 8px;
    }
    
    .play-pause-btn {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
    }
    
    .speed-btn-new {
        font-size: 1rem;
        padding: 8px 16px;
    }
    
    .control-row-center {
        margin-bottom: 3rem; /* Even more bottom margin for very small screens */
    }
}

.sound-wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.sound-wave {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 6px;
    height: 80px;
}

.sound-wave .wave-bar {
    width: 6px;
    background: linear-gradient(to top, #06b6d4, #6366f1, #8b5cf6);
    border-radius: 3px;
    height: 15px;
    transition: height 0.4s ease-in-out;
}



.sound-wave.playing .wave-bar:nth-child(1) { animation: wave-play 1.2s ease-in-out infinite 0.1s; }
.sound-wave.playing .wave-bar:nth-child(2) { animation: wave-play 1.2s ease-in-out infinite 0.3s; }
.sound-wave.playing .wave-bar:nth-child(3) { animation: wave-play 1.2s ease-in-out infinite 0.5s; }
.sound-wave.playing .wave-bar:nth-child(4) { animation: wave-play 1.2s ease-in-out infinite 0.2s; }
.sound-wave.playing .wave-bar:nth-child(5) { animation: wave-play 1.2s ease-in-out infinite 0.4s; }
.sound-wave.playing .wave-bar:nth-child(6) { animation: wave-play 1.2s ease-in-out infinite 0.6s; }

.sound-wave.paused .wave-bar {
    height: 6px;
}

@keyframes wave-play {
    0% { height: 15px; }
    50% { height: 144px; }
    100% { height: 15px; }
}

.play-pause-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #4A80F5;
    border: none;
    box-shadow: 0 8px 32px rgba(74, 128, 245, 0.4);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.play-pause-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(74, 128, 245, 0.6);
    background: #3B71F3;
}

.play-pause-btn:active {
    transform: scale(0.95);
}

.play-pause-btn i {
    z-index: 2;
    position: relative;
}

.play-pause-btn #playIcon {
    margin-left: 4px;
}

.play-pause-btn #playIcon {
    margin-left: 4px;
}

.ripple-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.6s ease;
}

.play-pause-btn:active .ripple-effect {
    transform: translate(-50%, -50%) scale(1);
}

/* Disable button state */
.btn:disabled {
    transform: none !important;
    box-shadow: none !important;
}

/* File Input Customization */
.file-input-custom {
    font-size: 0.9rem;
    color: #6c757d;
}

.file-input-custom::file-selector-button {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
}

/* Custom file input placeholder styling */
.file-input-custom::-webkit-file-upload-button {
    font-size: 0.85rem;
}

/* File input placeholder simulation */
.file-input-custom[data-placeholder]:not([value])::before {
    content: attr(data-placeholder);
    color: #adb5bd;
    font-size: 0.85rem;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.file-input-custom {
    position: relative;
}
