/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #667eea;
}

/* Main Container */
.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 2rem auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle {
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 400;
}

/* Support Section */
.support-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.buymeacoffee-btn {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-bottom: 0.5rem;
}

.buymeacoffee-btn:hover {
    transform: translateY(-2px);
}

.buymeacoffee-btn img {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.support-text {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

/* Form Elements */
.form-group {
    margin-bottom: 32px;
}

.form-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #f1f5f9;
    transform: translateY(-2px);
}

.file-upload-area.dragover {
    border-color: #667eea;
    background: #e0e7ff;
    transform: scale(1.02);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.upload-text {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 8px;
    font-weight: 500;
}

.upload-hint {
    font-size: 0.9rem;
    color: #94a3b8;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-info {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    display: none;
    align-items: center;
    gap: 12px;
}

.file-info.show {
    display: flex;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: #667eea;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.file-size {
    font-size: 0.85rem;
    color: #64748b;
}

/* Select Dropdown */
.select-wrapper {
    position: relative;
}

.language-select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    color: #334155;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 48px;
}

.language-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.transcribe-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.transcribe-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.transcribe-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.transcribe-btn .loading {
    display: none;
}

.transcribe-btn.loading .loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.transcribe-btn.loading .btn-text {
    display: none;
}

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

/* Result Section */
.result-section {
    margin-top: 32px;
    display: none;
}

.result-section.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

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

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

.result-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #334155;
}

.result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn, .copy-btn {
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.action-btn:hover, .copy-btn:hover {
    background: #e2e8f0;
}

.transcription-result {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
    min-height: 120px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Features Section */
.features-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 80px 0;
    margin: 4rem 0;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.features-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #64748b;
    line-height: 1.6;
}

/* FAQ Section */
.faq-item {
    margin-bottom: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.faq-question {
    color: #334155;
    margin: 0;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.faq-question:hover {
    background: #f8fafc;
    color: #667eea;
}

.faq-question.active {
    background: #667eea;
    color: white;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.faq-question.active::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    display: none;
}

.faq-answer p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
}

.footer-section h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #667eea;
}

.footer-section p {
    color: #94a3b8;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #667eea;
}

.footer-bottom {
    border-top: 1px solid #374151;
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    color: #94a3b8;
}

/* Page Styles for Secondary Pages */
.page-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 2rem;
    text-align: center;
}

.page-content {
    color: #475569;
    line-height: 1.8;
}

.page-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #334155;
    margin: 2rem 0 1rem 0;
}

.page-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155;
    margin: 1.5rem 0 0.75rem 0;
}

.page-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    margin: 1rem 0 0.5rem 0;
}

.page-content p {
    margin-bottom: 1rem;
}

.page-content ul, .page-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.page-content li {
    margin-bottom: 0.5rem;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Section Styling */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.page-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    min-height: auto;
    padding: 4rem 0;
}

.page-section:nth-child(even) {
    background: rgba(248, 250, 252, 0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }

    .container {
        padding: 20px;
        margin: 1rem 0.5rem;
        border-radius: 16px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .file-upload-area {
        padding: 30px 15px;
    }

    .result-header {
        flex-direction: column;
        align-items: stretch;
    }

    .result-actions {
        justify-content: center;
    }

    .features-title {
        font-size: 2rem;
    }

    .footer-container {
        padding: 0 1rem;
        grid-template-columns: 1fr;
        text-align: center;
    }

    .page-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .buymeacoffee-btn img {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .result-actions {
        flex-direction: column;
    }
    
    .action-btn, .copy-btn {
        text-align: center;
    }

    .support-section {
        padding: 1rem;
    }

    .buymeacoffee-btn img {
        width: 120px;
    }
}

/* Progress Bar Styles - Add these to your existing styles.css */

/* Button Group */
.button-group {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

/* Cancel Button */
.cancel-section {
    text-align: center;
    margin-top: 16px;
}

.cancel-btn {
    /* background: linear-gradient(135deg, #ff6b6b, #ee5a5a); */  /* red */
    /* background: linear-gradient(135deg, #667eea, #764ba2); */  /* same as transcribe button */
    background: #94a3b8; /* gray */
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    /* box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3); */
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cancel-btn:hover {
    /* background: linear-gradient(135deg, #ee5a5a, #dd4d4d); */
    /*background: linear-gradient(135deg, #5a6fd8, #6a42a0); */
    background: #64748b;
    transform: translateY(-2px);
    /* box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4); */
    /* box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); */
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.3);
}

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

/* Progress Section */
.progress-section {
    margin: 20px 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: none;
}

.progress-section.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.3s ease;
}

/* Progress Container */
.progress-container {
    width: 100%;
    height: 30px;
    background: linear-gradient(90deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

/* Progress Bar */
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049, #66bb6a);
    border-radius: 15px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Progress Text */
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #333;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* Progress Label */
.progress-label {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animation for fade in up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced button loading state */
.transcribe-btn.loading {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    cursor: not-allowed;
    position: relative;
}

.transcribe-btn.loading .loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.transcribe-btn.loading .btn-text {
    opacity: 0.7;
}

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

/* Progress states styling */
.progress-label[data-state="uploading"] {
    color: #007bff;
}

.progress-label[data-state="transcribing"] {
    color: #28a745;
}

.progress-label[data-state="complete"] {
    color: #6f42c1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .cancel-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .progress-container {
        height: 25px;
    }
    
    .progress-text {
        font-size: 12px;
    }
    
    .progress-label {
        font-size: 12px;
    }
}

/* Enhanced error message styling for progress context */
.error-message.show {
    animation: slideInFromTop 0.3s ease;
}

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

/* Delete button styles */
.file-info {
    position: relative;
}
.delete-file-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #94a3b8;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.2);
}

.delete-file-btn:hover {
    background: #64748b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.3);
}

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

/* Download Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.dropdown-menu:not([hidden]) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu[hidden] {
    display: none;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: none;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #667eea;
    padding-left: 20px;
}

.dropdown-item:active {
    background: #f1f5f9;
}

.dropdown-item:focus {
    outline: none;
    background: #f8fafc;
    color: #667eea;
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

/* Dropdown arrow animation */
.action-btn[aria-expanded="true"] {
    background: #e2e8f0;
}

/* Success message styling */
.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    display: none;
    animation: slideInFromTop 0.3s ease;
}

.success-message.show {
    display: block;
}

/* Loading overlay for PDF generation */
.pdf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.pdf-loading-overlay.show {
    display: flex;
}

.pdf-loading-content {
    background: white;
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.pdf-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.pdf-loading-text {
    color: #334155;
    font-size: 1.1rem;
    font-weight: 600;
}

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

/* Development Notice Box */
.dev-notice-box {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 2rem;
}

.dev-notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #92400e;
    font-size: 1.1rem;
}

.dev-notice-box .dev-notice-icon {
    font-size: 1.3rem;
}

.dev-notice-box p {
    color: #78350f;
    margin: 0;
    line-height: 1.6;
}

.dev-notice-box a {
    color: #b45309;
    text-decoration: underline;
    font-weight: 600;
}

.dev-notice-box a:hover {
    color: #92400e;
}