/* Core Variables & Resets */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #f1f5f9;
    --secondary-hover: #e2e8f0;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Typography & Layout */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 24px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* Tabs */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

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

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary-color); color: var(--text-primary); }
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-success { background: var(--success-color); color: white; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }
.btn-outline:hover { background: var(--primary-color); color: white; }

.btn-large { padding: 14px 28px; font-size: 1.1rem; width: 100%; max-width: 300px; }
.btn-sm { padding: 6px 12px; font-size: 0.875rem; }
.btn.disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-icon { background: none; border: none; font-size: 1.2rem; color: var(--text-secondary); cursor: pointer; transition: var(--transition); padding: 8px;}
.btn-icon:hover { color: var(--primary-color); }

/* Recording Animation */
.btn-icon.recording {
    color: var(--danger-color);
    animation: pulseMic 1.5s infinite;
}

@keyframes pulseMic {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); border-radius: 50%; }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); border-radius: 50%; }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); border-radius: 50%; }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-top: 40px;
}

.hero h1 { font-size: 2.5rem; color: var(--text-primary); margin-bottom: 16px; font-weight: 700; }
.hero p { font-size: 1.125rem; color: var(--text-secondary); margin-bottom: 32px; max-width: 600px; margin-inline: auto; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; }

/* Section Header */
.section-header { margin: 40px 0 24px; text-align: center; }
.section-header h2 { font-size: 2rem; color: var(--text-primary); margin-bottom: 8px; }
.section-header p { color: var(--text-secondary); }

/* Translators general */
.translator-container {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 24px;
}

.lang-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.lang-controls.no-margin { margin-bottom: 0; }

.lang-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-select-group label { font-weight: 500; color: var(--text-secondary); }
.lang-select-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface-color);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}
.lang-select-group select:focus { border-color: var(--primary-color); }

.btn-swap {
    background: var(--secondary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
}
.btn-swap:hover { background: var(--secondary-hover); }

/* Text Translation Area */
.text-areas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.input-area, .output-area {
    position: relative;
    display: flex;
    flex-direction: column;
}

.text-areas textarea {
    width: 100%;
    min-height: 250px;
    padding: 16px 16px 48px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    font-size: 1rem;
    background: var(--surface-color);
    transition: var(--transition);
    outline: none;
}

.text-areas textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.output-area textarea { background: var(--secondary-color); border-color: transparent; }

.action-bar {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
}

.translate-action { text-align: center; }

/* Loaders */
.loader-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 8px;
    z-index: 10;
    backdrop-filter: blur(2px);
}
.loader-overlay.hidden { display: none; }

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--secondary-hover);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* PDF Upload Zone */
.pdf-upload-container {
    background: var(--surface-color);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 60px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}
.pdf-upload-container:hover, .pdf-upload-container.drag-over {
    border-color: var(--primary-color);
    background: var(--secondary-color);
}
.pdf-upload-container.hidden { display: none; }

.upload-icon { font-size: 4rem; color: var(--primary-color); margin-bottom: 16px; }
.upload-content h3 { margin-bottom: 8px; color: var(--text-primary); }
.upload-content p { color: var(--text-secondary); margin-bottom: 24px; }

/* PDF Workspace */
.pdf-workspace {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 80vh;
}
.pdf-workspace.hidden { display: none; }

.workspace-controls {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--surface-color);
}

.file-info {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.file-info::before {
    content: '\f1c1';
    font-family: 'Font Awesome 6 Free';
    color: var(--danger-color);
}

.progress-container {
    padding: 16px 24px;
    background: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
}
.progress-container.hidden { display: none; }

.progress-container p { font-size: 0.875rem; margin-bottom: 8px; color: var(--text-secondary); font-weight: 500;}
.progress-bar-bg { height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary-color); transition: width 0.3s ease; }

.split-view {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.split-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
}
.split-pane:last-child { border-right: none; }

.pane-header {
    background: var(--secondary-color);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.pane-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--surface-color);
    line-height: 1.8;
}

.placeholder-msg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
}

/* PDF Content Blocks styles */
.pdf-block {
    margin-bottom: 1em;
    position: relative;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}
.pdf-block:hover { background-color: var(--secondary-color); }
.pdf-block { padding: 4px 8px; }

/* About Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}
.feature-card {
    background: var(--surface-color);
    padding: 32px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.feature-card i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 16px; }
.feature-card h3 { margin-bottom: 12px; color: var(--text-primary); }
.feature-card p { color: var(--text-secondary); }

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px; left: 0; width: 100%;
        background: var(--surface-color);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-md);
        gap: 16px;
    }
    .nav-links.show { display: flex; }
    .nav-links a.active::after { bottom: -5px; }
    .mobile-menu-btn { display: block; }
    
    .text-areas { grid-template-columns: 1fr; }
    .split-view { flex-direction: column; }
    .pdf-workspace { height: auto; min-height: 80vh; }
    .split-pane { border-right: none; border-bottom: 1px solid var(--border-color); min-height: 400px; }
    .workspace-controls { flex-direction: column; align-items: stretch; }
}
