* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 580px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.logo {
    height: 48px;
    width: auto;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

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

.header-text h1 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
    font-weight: 600;
}

/* Ensure the header doesn't get too wide on large screens */
@media (min-width: 1200px) {
    .header-content {
        max-width: 1200px;
        margin: 0 auto 1rem;
    }
}

.recorder-section {
    text-align: center;
    margin: 20px 0;
    padding: 24px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.record-button {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    line-height: 1.3;
}

.record-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.record-button.recording {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(231, 76, 60, 0.8);
    }
}

.timer {
    margin-top: 12px;
    font-size: 22px;
    font-weight: 600;
    color: #667eea;
    font-variant-numeric: tabular-nums;
}

.status {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    min-height: 18px;
    white-space: pre-line;
}

.audio-player {
    margin-top: 16px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: none;
}

.audio-player.visible {
    display: block;
}

audio {
    width: 100%;
    height: 40px;
}

.results-section {
    margin-top: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    display: none;
}

.results-section.visible {
    display: block;
}

.transcription {
    background: white;
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.transcription-latin {
    color: #333;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 500;
}

.share-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

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

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

.copy-btn {
    background: #3498db;
    color: white;
}

.copy-btn:hover {
    background: #2980b9;
}

.copy-btn.copied {
    background: #27ae60;
}

.whatsapp-btn {
    background: #25D366;
    color: white;
}

.whatsapp-btn:hover {
    background: #128C7E;
}

.share-btn svg {
    flex-shrink: 0;
}

.error {
    background: #ffe6e6;
    color: #c0392b;
    padding: 12px 14px;
    border-radius: 8px;
    border-left: 3px solid #e74c3c;
    white-space: pre-wrap;
    font-size: 14px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 1.25rem;
    padding: 1rem;
    color: #666;
    font-size: 0.85rem;
}

footer p {
    margin: 0.2rem 0;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .header-text {
        text-align: center;
        width: 100%;
    }

    .logo {
        height: 44px;
    }

    .header-text h1 {
        font-size: 1.15rem;
    }

    .record-button {
        width: 100px;
        height: 100px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    .header-text h1 {
        font-size: 1.05rem;
    }

    .recorder-section {
        padding: 20px 16px;
    }

    footer {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
}
