/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Textura de papel */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Container principal */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    background: rgba(33, 150, 243, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(33, 150, 243, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 20px;
}

.app-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Conteúdo principal */
.main-content {
    margin-bottom: 20px;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
    display: block;
}

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

/* Cards */
.welcome-card,
.practice-container,
.analysis-container,
.history-container,
.tips-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.welcome-card h2,
.practice-container h2,
.analysis-container h2,
.history-container h2,
.tips-container h2 {
    color: #2196F3;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* Estatísticas rápidas */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.stat-item i {
    font-size: 1.5rem;
    color: #2196F3;
    margin-bottom: 8px;
    display: block;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Botões */
.btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

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

.btn-primary {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.btn-secondary {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.btn-danger {
    background: linear-gradient(135deg, #F44336, #D32F2F);
}

.btn-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.btn-outline {
    background: transparent;
    color: #2196F3;
    border: 2px solid #2196F3;
    box-shadow: none;
}

.btn-outline:hover {
    background: #2196F3;
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

/* Botões de ação */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 25px 0;
}

/* Card de dicas */
.tips-card {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.tips-card h3 {
    color: #FFC107;
    margin-bottom: 10px;
}

/* Controles de gravação */
.recording-controls {
    text-align: center;
    margin-bottom: 25px;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Status de gravação */
.recording-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4CAF50;
    font-weight: 500;
}

.status-indicator.recording {
    color: #F44336;
}

.status-indicator.recording i {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.audio-level {
    width: 100px;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.level-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #FFC107, #F44336);
    width: 0%;
    transition: width 0.1s ease;
}

/* Feedback em tempo real */
.live-feedback {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.live-feedback h3 {
    color: #2196F3;
    margin-bottom: 15px;
}

.feedback-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.feedback-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.feedback-label {
    font-weight: 500;
    color: #666;
}

.feedback-value {
    font-weight: bold;
    color: #2196F3;
}

/* Sugestões de tópicos */
.topic-suggestions {
    margin-top: 25px;
}

.topic-suggestions h3 {
    color: #9C27B0;
    margin-bottom: 15px;
}

.topic-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.topic-btn {
    background: rgba(156, 39, 176, 0.1);
    border: 1px solid rgba(156, 39, 176, 0.3);
    color: #9C27B0;
    padding: 12px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: center;
}

.topic-btn:hover,
.topic-btn.active {
    background: #9C27B0;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

.selected-topic {
    padding: 15px;
    background: rgba(156, 39, 176, 0.1);
    border-radius: 10px;
    color: #9C27B0;
    font-weight: 500;
    text-align: center;
    margin-top: 10px;
    display: none;
}

.selected-topic.visible {
    display: block;
}

/* Análise */
.analysis-summary {
    padding: 20px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
    color: #4CAF50;
    font-weight: 500;
}

.analysis-charts {
    margin-bottom: 25px;
}

.chart-container {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    color: #2196F3;
    margin-bottom: 15px;
    text-align: center;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
}

.filler-words {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.filler-word-item {
    text-align: center;
    padding: 15px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.filler-word {
    display: block;
    font-weight: bold;
    color: #F44336;
    margin-bottom: 5px;
}

.filler-count {
    color: #666;
    font-size: 0.9rem;
}

/* Sugestões de melhoria */
.improvement-suggestions {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.improvement-suggestions h3 {
    color: #FFC107;
    margin-bottom: 15px;
}

.improvement-suggestions ul {
    list-style: none;
}

.improvement-suggestions li {
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    border-left: 4px solid #FFC107;
}

/* Card de pontuação */
.score-card {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.score-card h3 {
    color: #4CAF50;
    margin-bottom: 20px;
}

.score-display {
    margin-bottom: 20px;
}

.score-number {
    font-size: 3rem;
    font-weight: bold;
    color: #4CAF50;
}

.score-max {
    font-size: 1.5rem;
    color: #666;
}

.score-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.score-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.score-item span:first-child {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.score-item span:last-child {
    font-weight: bold;
    color: #4CAF50;
}

/* Histórico */
.history-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid rgba(33, 150, 243, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #2196F3;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
}

.filter-select:focus {
    border-color: #2196F3;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.3);
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.history-date {
    color: #666;
    font-size: 0.9rem;
}

.history-score {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

.history-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.history-detail {
    text-align: center;
    padding: 8px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 10px;
}

.history-detail-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.history-detail-value {
    font-weight: bold;
    color: #2196F3;
}

.history-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
    display: block;
}

/* Dicas */
.tips-categories {
    display: grid;
    gap: 25px;
}

.tip-category {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.tip-category h3 {
    color: #2196F3;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.tip-items {
    display: grid;
    gap: 15px;
}

.tip-item {
    padding: 15px;
    background: rgba(33, 150, 243, 0.05);
    border-radius: 10px;
    border-left: 4px solid #2196F3;
}

.tip-item h4 {
    color: #2196F3;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.tip-item p {
    color: #666;
    line-height: 1.5;
}

/* FAQ */
.faq-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.faq-section h2 {
    color: #2196F3;
    margin-bottom: 20px;
    text-align: center;
}

.faq-container {
    display: grid;
    gap: 15px;
}

.faq-item {
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.8);
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: #2196F3;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(33, 150, 243, 0.05);
}

.faq-question[aria-expanded="true"] {
    background: rgba(33, 150, 243, 0.1);
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 20px 20px;
    color: #666;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
}

.faq-answer[hidden] {
    display: none;
}

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

/* Navegação inferior */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    color: #666;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 15px;
    transition: all 0.3s ease;
    min-width: 60px;
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 0.75rem;
}

.nav-item:hover,
.nav-item.active {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 40px;
}

/* Responsividade */
@media (max-width: 768px) {
    .app-container {
        padding: 0 15px;
    }
    
    .app-header {
        margin-top: 15px;
        padding: 15px;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .welcome-card,
    .practice-container,
    .analysis-container,
    .history-container,
    .tips-container,
    .faq-section {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .control-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .recording-status {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .timer-display {
        font-size: 2rem;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .history-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .faq-question {
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0 10px;
    }
    
    .quick-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .topic-buttons {
        grid-template-columns: 1fr;
    }
    
    .score-breakdown {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .history-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feedback-items {
        grid-template-columns: 1fr;
    }
}

/* Animações e transições suaves */
.btn, .nav-item, .faq-question, .topic-btn, .history-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(33, 150, 243, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(33, 150, 243, 0.5);
}

/* Estados de loading */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #2196F3;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Melhorias de acessibilidade */
.btn:focus,
.nav-item:focus,
.faq-question:focus,
.topic-btn:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* Estados de sucesso e erro */
.success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #F44336;
}

.warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #FFC107;
}
