/* Reset e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2d2d2d 100%);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Overlay de Transcrição */
.transcription-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

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

/* Container Principal */
.container {
    background: rgba(25, 25, 25, 0.85);
    backdrop-filter: blur(24px);
    border-radius: 24px;
    padding: 40px 32px;
    min-width: 480px;
    max-width: 600px;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.transcription-overlay.active .container {
    transform: scale(1) translateY(0);
}

/* Ícone de Ouvindo */
.listening-icon {
    margin-bottom: 32px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sound-waves {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.orb {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3a3a3a 0%, #1f1f1f 100%);
    border-radius: 50%;
    position: relative;
    z-index: 2;
    animation: orbPulse 2s ease-in-out infinite;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.06),
        0 0 40px rgba(255, 255, 255, 0.04);
}

.wave {
    position: absolute;
    border: 2px solid;
    border-radius: 50%;
    opacity: 0;
    animation: wavePulse 2s ease-in-out infinite;
}

.wave-1 {
    width: 60px;
    height: 60px;
    border-color: rgba(138, 43, 226, 0.6);
    animation-delay: 0s;
}

.wave-2 {
    width: 80px;
    height: 80px;
    border-color: rgba(65, 105, 225, 0.4);
    animation-delay: 0.7s;
}

.wave-3 {
    width: 100px;
    height: 100px;
    border-color: rgba(138, 43, 226, 0.2);
    animation-delay: 1.4s;
}

/* Animações */
@keyframes orbPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 20px rgba(255, 255, 255, 0.06),
            0 0 40px rgba(255, 255, 255, 0.04);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 
            0 0 30px rgba(255, 255, 255, 0.1),
            0 0 60px rgba(255, 255, 255, 0.06);
    }
}

@keyframes wavePulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* Área de Texto Transcrito */
.transcription-text {
    margin-bottom: 24px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    max-height: 42vh; /* limit height to allow scrollbar when text is long */
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
}

.typing-text {
    color: #F0F0F0;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.01em;
    opacity: 0;
    animation: typeIn 0.5s ease-out 0.8s forwards;
    word-break: break-word;
    hyphens: auto;
}

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

/* Texto de Ajuda */
.help-text {
    color: #A0A0A0;
    font-size: 14px;
    font-weight: 300;
    opacity: 0.8;
    letter-spacing: 0.02em;
}

/* Controles de Demonstração */
.demo-controls {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
}

.start-btn {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 24px rgba(42, 42, 42, 0.3),
        0 4px 12px rgba(26, 26, 26, 0.2);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 32px rgba(42, 42, 42, 0.4),
        0 6px 16px rgba(26, 26, 26, 0.3);
}

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

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsividade */
@media (max-width: 640px) {
    .container {
        min-width: 320px;
        max-width: 90vw;
        padding: 32px 24px;
    }
    
    .typing-text {
        font-size: 16px;
    }
    
    .start-btn {
        padding: 14px 24px;
        font-size: 14px;
    }
    
    .transcription-text {
        max-height: 50vh; /* a bit taller on mobile */
    }
}

/* Efeito de digitação em tempo real */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #8A2BE2;
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Seleção de Modo de Captura */
.capture-mode-selector {
    text-align: center;
    margin-top: 60px;
    margin-bottom: 40px;
    padding: 32px;
    background: rgba(15, 15, 15, 0.95);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mode-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.mode-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    backdrop-filter: blur(8px);
}

.mode-circle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.mode-circle.active {
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    border-color: transparent;
    box-shadow: 
        0 8px 32px rgba(0, 122, 255, 0.3),
        0 4px 16px rgba(0, 81, 213, 0.2);
}

.mode-circle.active:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 12px 40px rgba(0, 122, 255, 0.4),
        0 6px 20px rgba(0, 81, 213, 0.3);
}

.mode-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.mode-icon svg {
    width: 24px;
    height: 24px;
}

.mode-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-align: center;
    line-height: 1;
}

.mode-description {
    color: #cccccc;
    font-size: 14px;
    text-align: center;
    margin-top: 24px;
    margin-bottom: 0;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    line-height: 1.4;
}

.learn-more {
    display: flex;
    justify-content: center;
}

.learn-more-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.learn-more-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.current-mode {
    margin-top: 12px;
    color: #8A2BE2;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* Ajustes para demo-controls */
.demo-controls {
    margin-top: 80px;
}

/* ============================ */
/* Upload Modal Styles          */
/* ============================ */
.hidden { display: none !important; }

.upload-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1100;
}

.upload-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: calc(100vw - 32px);
    background: #121212;
    color: #F0F0F0;
    border-radius: 16px;
    padding: 24px;
    z-index: 1101;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 8px 32px rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.06);
}

.upload-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #bbb;
    font-size: 22px;
    line-height: 32px;
    cursor: pointer;
    border-radius: 6px;
}
.upload-close:hover { background: rgba(255,255,255,0.06); color: #fff; }

.upload-title {
    font-size: 18px;
    margin: 8px 0 16px 0;
    font-weight: 600;
}

.upload-requirements {
    background: #1F1F1F;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.upload-requirements ul {
    margin-left: 16px;
    line-height: 1.7;
}

.upload-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-file-label {
    display: inline-block;
    background: #2A2A2A;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    width: fit-content;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.08);
}
.upload-file-label:hover { background: #343434; }

/* Dropzone state */
.upload-dropzone {
    user-select: none;
}
.upload-dropzone.dragover {
    background: #383838;
    border-color: rgba(255,255,255,0.18);
}

.upload-file-input {
    display: none; /* ocultar input nativo */
}

.upload-feedback {
    font-size: 12px;
    color: #cfcfcf;
    opacity: 0.9;
}

.upload-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.upload-clear {
    background: transparent;
    color: #bbbbbb;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}
.upload-clear:hover { background: rgba(255,255,255,0.06); color: #fff; }

.upload-submit {
    margin-top: 12px;
    width: 100%;
    background: #333333;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.02s ease;
}
.upload-submit:hover { background: #3b3b3b; }
.upload-submit:active { transform: translateY(1px); }
.upload-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* removed emoji icon */

/* Subtle scrollbar styling for the transcript area */
.transcription-text::-webkit-scrollbar {
    width: 8px;
}
.transcription-text::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}
.transcription-text::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
.transcription-text::-webkit-scrollbar-track {
    background: transparent;
}
/* Firefox */
.transcription-text {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

/* Toasts (CSS-based messages for status/errors) */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(25, 25, 25, 0.95);
    color: #F0F0F0;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    z-index: 1001;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: fadeIn 0.2s ease-out;
}

.toast.toast--error {
    background: rgba(220, 38, 38, 0.92);
}

.toast.toast--info {
    background: rgba(37, 99, 235, 0.92);
}

.toast .toast-title {
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.toast .toast-footer {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.85;
}