/* ==========================================================================
   STYLE.CSS — Translation Website
   Complete production-ready stylesheet
   ========================================================================== */

/* ==========================================================================
   1. CSS VARIABLES
   ========================================================================== */

:root {
    --primary: #1a73e8;
    --primary-hover: #1557b0;
    --primary-light: #e8f0fe;
    --secondary: #34a853;
    --secondary-hover: #2d9249;
    --accent: #fbbc04;
    --error: #ea4335;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e8eaed;
    --bg-widget: #ffffff;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #80868b;
    --border: #dadce0;
    --border-focus: #1a73e8;
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-xl: 0 8px 32px rgba(0,0,0,0.15);
    --max-width: 1200px;
    --header-height: 64px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --primary: #8ab4f8;
    --primary-hover: #aecbfa;
    --primary-light: #1a2744;
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --bg-widget: #1e1e1e;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-tertiary: #80868b;
    --border: #3c4043;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Respect the hidden attribute even on elements with explicit display */
[hidden] {
    display: none !important;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: 16px;
    line-height: 1.15;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1em;
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

strong,
b {
    font-weight: 600;
}

small {
    font-size: 0.875rem;
}

/* ==========================================================================
   4. LAYOUT
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

section {
    padding-top: 48px;
    padding-bottom: 48px;
}

main {
    padding-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ==========================================================================
   5. SKIP LINK
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 12px 24px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: top var(--transition);
}

.skip-link:focus {
    top: 0;
    outline: none;
    color: #ffffff;
}

/* ==========================================================================
   6. ANNOUNCEMENT BAR
   ========================================================================== */

.announcement-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 24px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    position: relative;
}

.announcement-bar a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.announcement-bar a:hover {
    opacity: 0.9;
}

.announcement-bar .announcement-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.25rem;
    line-height: 1;
    transition: background var(--transition);
}

.announcement-bar .announcement-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   7. HEADER
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition), background var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo img {
    height: 32px;
    width: auto;
}

.logo span {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-list > li {
    position: relative;
}

.nav-list > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

.nav-list > li > a:hover,
.nav-list > li > a.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
    cursor: pointer;
}

.dropdown-toggle:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform var(--transition);
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    min-width: 220px;
    padding: 8px;
    background: var(--bg-widget);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.dropdown-menu a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.dropdown-menu a .dropdown-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.theme-toggle button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}

.theme-toggle button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* Mobile Menu Toggle (Hamburger) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    gap: 5px;
    padding: 0;
}

.mobile-menu-toggle:hover {
    background: var(--bg-tertiary);
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Header actions group */
.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   8. TRANSLATOR WIDGET
   ========================================================================== */

.translator-widget {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 0;
}

.translator-panels {
    display: flex;
    flex-direction: row;
    gap: 0;
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-widget);
    box-shadow: var(--shadow-md);
}

.translator-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.translator-panel:first-child {
    border-right: 1px solid var(--border);
}

/* Panel Header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    min-height: 52px;
}

.panel-header .panel-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Language Select */
.lang-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 8px 36px 8px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M3 5l3 3 3-3z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-width: 140px;
}

.lang-select:hover {
    border-color: var(--text-tertiary);
}

.lang-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

/* Translator Textareas */
.translator-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    font-size: 1rem;
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    resize: none;
}

.translator-textarea::placeholder {
    color: var(--text-tertiary);
}

.target-textarea {
    background: var(--bg-secondary);
    cursor: default;
}

/* Swap Button */
.swap-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

.swap-btn:hover {
    transform: translate(-50%, -50%) rotate(180deg);
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.swap-btn:active {
    transform: translate(-50%, -50%) rotate(180deg) scale(0.95);
}

.swap-btn.swapping {
    animation: swapSpin 0.5s ease;
}

@keyframes swapSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Panel Actions */
.panel-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
}

/* Action Buttons (icon buttons) */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.action-btn:active {
    background: var(--border);
}

.action-btn svg,
.action-btn img {
    width: 18px;
    height: 18px;
}

.action-btn.recording {
    color: var(--error);
    background: rgba(234, 67, 53, 0.1);
    animation: pulse 1.5s infinite;
}

.action-btn.copied {
    color: var(--secondary);
    background: rgba(52, 168, 83, 0.1);
}

.action-btn.copied::after {
    content: '';
}

/* Translate Button */
.translate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    padding: 0 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    margin-top: 16px;
}

.translate-btn:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-sm);
}

.translate-btn:active {
    transform: scale(0.98);
}

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

.translate-btn-loading {
    position: relative;
    pointer-events: none;
}

.translate-btn-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Character Counter */
.char-counter {
    position: absolute;
    bottom: 44px;
    right: 16px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.char-counter.limit-near {
    color: var(--accent);
}

.char-counter.limit-reached {
    color: var(--error);
    font-weight: 600;
}

/* Keyboard Hint */
.keyboard-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 12px;
}

.keyboard-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.6875rem;
    font-family: var(--font-family);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    box-shadow: 0 1px 0 var(--border);
}

/* Shimmer Loader */
.shimmer-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    overflow: hidden;
    z-index: 5;
    border-radius: inherit;
}

.shimmer-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

[data-theme="dark"] .shimmer-loader::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
}

/* API Key Notice */
.api-key-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: #fef7e0;
    border: 1px solid #f5e6b8;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: #5f4b00;
    margin-top: 16px;
}

[data-theme="dark"] .api-key-notice {
    background: #3e3517;
    border-color: #5c4e23;
    color: #f5e6b8;
}

.api-key-notice svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.api-key-notice a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* ==========================================================================
   9. TOOLS BAR
   ========================================================================== */

.tools-bar {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.tools-scroll {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    -webkit-overflow-scrolling: touch;
}

.tools-scroll::-webkit-scrollbar {
    height: 4px;
}

.tools-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.tools-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition), background var(--transition), box-shadow var(--transition);
    text-decoration: none;
}

.tool-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-xs);
}

.tool-chip:active {
    transform: scale(0.97);
}

.tool-chip svg,
.tool-chip img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.tool-chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ==========================================================================
   10. FEATURES SECTION
   ========================================================================== */

.features-section {
    padding: 64px 0;
}

.features-section h2 {
    text-align: center;
    margin-bottom: 12px;
}

.features-section .section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-widget);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-card .feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-size: 1.5rem;
}

.feature-card .feature-icon svg,
.feature-card .feature-icon img {
    width: 28px;
    height: 28px;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}

/* ==========================================================================
   11. LANGUAGE GRID
   ========================================================================== */

.lang-grid-section {
    padding: 48px 0;
}

.lang-grid-section h2 {
    text-align: center;
    margin-bottom: 32px;
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.lang-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-widget);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    text-decoration: none;
}

.lang-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-xs);
    color: var(--primary);
}

.lang-card .lang-flag {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.lang-card .lang-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   12. SEO CONTENT
   ========================================================================== */

.seo-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px;
}

.seo-content h2 {
    font-size: 1.5rem;
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: var(--text-primary);
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content h3 {
    font-size: 1.2rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.seo-content p {
    margin-bottom: 1.25em;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

.seo-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.seo-content a:hover {
    color: var(--primary-hover);
}

.seo-content ol,
.seo-content ul {
    margin-bottom: 1.25em;
    padding-left: 1.5em;
}

.seo-content ol {
    list-style: decimal;
}

.seo-content ul {
    list-style: disc;
}

.seo-content li {
    margin-bottom: 0.5em;
    color: var(--text-secondary);
    line-height: 1.6;
}

.seo-content blockquote {
    margin: 1.5em 0;
    padding: 16px 24px;
    border-left: 4px solid var(--primary);
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* ==========================================================================
   13. FAQ SECTION
   ========================================================================== */

.faq-section {
    padding: 48px 0;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 32px;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:first-child {
    border-top: 1px solid var(--border);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    background: none;
    border: none;
    gap: 16px;
    transition: color var(--transition);
}

.faq-question:hover {
    color: var(--primary);
}

.faq-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform var(--transition);
    color: var(--text-tertiary);
}

.faq-icon svg {
    width: 20px;
    height: 20px;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-answer {
    display: none;
    padding: 0 0 20px 0;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9375rem;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-answer p {
    margin-bottom: 0.75em;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ==========================================================================
   14. PHRASES TABLE
   ========================================================================== */

.phrases-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 24px 0;
}

.phrases-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.phrases-table thead {
    background: var(--bg-secondary);
}

.phrases-table th {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.phrases-table td {
    padding: 14px 18px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.phrases-table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

.phrases-table tbody tr:hover {
    background: var(--primary-light);
}

.phrases-table tbody tr:last-child td {
    border-bottom: none;
}

.phrases-table .pronunciation {
    font-style: italic;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ==========================================================================
   15. BLOG
   ========================================================================== */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.post-card {
    background: var(--bg-widget);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.post-card .post-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.post-card .post-body {
    padding: 20px;
}

.post-card .post-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.post-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-card h3 a {
    color: var(--text-primary);
    transition: color var(--transition);
}

.post-card h3 a:hover {
    color: var(--primary);
}

.post-card .post-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .post-date {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* Blog Post Single */
.blog-post {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 24px;
}

.post-header {
    margin-bottom: 32px;
    text-align: center;
}

.post-header h1 {
    font-size: 2rem;
    margin-bottom: 16px;
    line-height: 1.3;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta a {
    color: var(--primary);
}

.post-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-content h2 {
    font-size: 1.5rem;
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: var(--text-primary);
}

.post-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

.post-content p {
    margin-bottom: 1.25em;
}

.post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content img {
    border-radius: var(--radius-sm);
    margin: 24px 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.25em;
    padding-left: 1.5em;
}

.post-content ul {
    list-style: disc;
}

.post-content ol {
    list-style: decimal;
}

.post-content li {
    margin-bottom: 0.5em;
}

.post-content blockquote {
    margin: 1.5em 0;
    padding: 16px 24px;
    border-left: 4px solid var(--primary);
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.post-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
    padding: 2px 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xs);
}

.post-content pre {
    margin: 1.5em 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.post-content pre code {
    padding: 0;
    background: none;
}

/* ==========================================================================
   16. FOOTER
   ========================================================================== */

.site-footer {
    background: #202124;
    color: #e8eaed;
    padding: 48px 0 0;
    margin-top: 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    padding-bottom: 40px;
}

.footer-col h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 18px;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col ul li a {
    font-size: 0.875rem;
    color: #9aa0a6;
    transition: color var(--transition);
}

.footer-col ul li a:hover {
    color: #ffffff;
}

.footer-col p {
    font-size: 0.875rem;
    color: #9aa0a6;
    line-height: 1.6;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 0;
    border-top: 1px solid #3c4043;
    font-size: 0.8125rem;
    color: #80868b;
}

.footer-bottom a {
    color: #9aa0a6;
    transition: color var(--transition);
}

.footer-bottom a:hover {
    color: #ffffff;
}

.footer-bottom-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

/* ==========================================================================
   17. RELATED SECTION
   ========================================================================== */

.related-section {
    padding: 48px 0;
}

.related-section h2 {
    margin-bottom: 24px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.related-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--bg-widget);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
    text-decoration: none;
}

.related-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.related-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.related-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}

/* ==========================================================================
   18. BREADCRUMBS
   ========================================================================== */

.breadcrumb {
    padding: 16px 0;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    font-size: 0.8125rem;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
}

.breadcrumb-list li + li::before {
    content: "\203A";
    display: inline-block;
    margin: 0 8px;
    font-size: 1rem;
    color: var(--text-tertiary);
}

.breadcrumb-list li a {
    color: var(--text-secondary);
    transition: color var(--transition);
}

.breadcrumb-list li a:hover {
    color: var(--primary);
}

.breadcrumb-list li:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* ==========================================================================
   19. COOKIE CONSENT
   ========================================================================== */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 20px 24px;
    background: var(--bg-widget);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-consent p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    max-width: 600px;
}

.cookie-consent p a {
    color: var(--primary);
    text-decoration: underline;
}

.cookie-consent .cookie-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border: none;
    white-space: nowrap;
}

.cookie-btn.cookie-btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.cookie-btn.cookie-btn-primary:hover {
    background: var(--primary-hover);
}

.cookie-btn.cookie-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.cookie-btn.cookie-btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* ==========================================================================
   20. ADSENSE
   ========================================================================== */

.adsense-container {
    margin: 24px auto;
    text-align: center;
    min-height: 90px;
    max-width: var(--max-width);
    overflow: hidden;
}

.adsense-container.adsense-leaderboard {
    min-height: 90px;
}

.adsense-container.adsense-rectangle {
    min-height: 250px;
    max-width: 336px;
}

.adsense-container.adsense-sidebar {
    min-height: 600px;
}

.adsense-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

/* ==========================================================================
   21. TOOL PAGES
   ========================================================================== */

.tool-interface {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 0;
}

.tool-interface h1 {
    margin-bottom: 8px;
}

.tool-interface .tool-description {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Upload Zone */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    min-height: 200px;
}

.upload-zone:hover {
    border-color: var(--text-tertiary);
    background: var(--bg-tertiary);
}

.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-zone .upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
}

.upload-zone .upload-icon svg {
    width: 28px;
    height: 28px;
}

.upload-zone .upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.upload-zone .upload-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.upload-zone input[type="file"] {
    display: none;
}

/* Camera Container */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
}

.camera-container video {
    width: 100%;
    display: block;
}

.camera-container .camera-overlay {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
}

.camera-container .camera-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #202124;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition);
}

.camera-container .camera-btn:hover {
    transform: scale(1.05);
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-bar.progress-success {
    background: var(--secondary);
}

.progress-bar.progress-error {
    background: var(--error);
}

/* Tool Output */
.tool-output {
    margin-top: 24px;
}

.tool-output pre {
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary);
}

.tool-output .output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tool-output .output-header h3 {
    font-size: 1rem;
    margin-bottom: 0;
}

/* ==========================================================================
   22. PAGE-SPECIFIC LAYOUTS
   ========================================================================== */

/* Single page */
.page-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

.page-single h1 {
    margin-bottom: 24px;
}

/* List page */
.page-list {
    padding: 32px 0;
}

.page-list h1 {
    margin-bottom: 24px;
}

.page-list .list-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-list .filter-btn {
    padding: 8px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition);
}

.page-list .filter-btn:hover,
.page-list .filter-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* 404 page */
.page-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
    padding: 48px 24px;
}

.page-404 .error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 16px;
}

.page-404 h1 {
    font-size: 1.75rem;
    margin-bottom: 12px;
}

.page-404 p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin-bottom: 32px;
}

.page-404 .btn-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.page-404 .btn-home:hover {
    background: var(--primary-hover);
    color: #ffffff;
}

/* Translator page */
.translator-page {
    padding-top: 16px;
}

.translator-page .translator-heading {
    text-align: center;
    margin-bottom: 8px;
}

.translator-page .translator-subheading {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   23. UTILITIES
   ========================================================================== */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

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

.text-right {
    text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* ==========================================================================
   24. ANIMATIONS / KEYFRAMES
   ========================================================================== */

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

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

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s ease forwards;
}

/* ==========================================================================
   25. RESPONSIVE — 1024px
   ========================================================================== */

@media (max-width: 1024px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    section {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .translator-widget {
        max-width: 100%;
    }
}

/* ==========================================================================
   26. RESPONSIVE — 768px
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    section {
        padding-top: 32px;
        padding-bottom: 32px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    /* Mobile Menu Toggle visible */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Main Nav — full-screen overlay */
    .main-nav {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        background: var(--bg-primary);
        padding: 24px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-nav.open {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-list > li > a {
        padding: 14px 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    .dropdown-toggle {
        padding: 14px 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        width: 100%;
        justify-content: space-between;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0 0 0 16px;
        display: none;
        background: transparent;
    }

    .dropdown-menu.show {
        display: block;
    }

    .dropdown-menu a {
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
    }

    /* Translator panels stack */
    .translator-panels {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    .translator-panel {
        width: 100%;
    }

    .translator-panel:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .translator-textarea {
        min-height: 150px;
    }

    /* Swap button repositioned */
    .swap-btn {
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        position: relative;
        margin: -22px auto;
        z-index: 10;
    }

    .swap-btn:hover {
        transform: translateX(-50%) rotate(180deg);
    }

    .swap-btn:active {
        transform: translateX(-50%) rotate(180deg) scale(0.95);
    }

    /* Features single column */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-card {
        padding: 24px 20px;
    }

    /* Posts single column */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Language grid adjustments */
    .lang-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }

    /* Blog post */
    .blog-post {
        padding: 24px 16px;
    }

    .post-header h1 {
        font-size: 1.5rem;
    }

    /* Announcement bar */
    .announcement-bar {
        padding: 10px 48px 10px 16px;
        font-size: 0.8125rem;
    }

    /* Cookie consent stacks */
    .cookie-consent {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 16px;
    }

    /* Tool pages */
    .upload-zone {
        padding: 32px 16px;
    }

    /* Related grid */
    .related-grid {
        grid-template-columns: 1fr;
    }

    /* SEO content */
    .seo-content {
        padding: 32px 16px;
    }

    /* FAQ */
    .faq-question {
        padding: 16px 0;
        font-size: 0.9375rem;
    }

    /* Table responsive */
    .phrases-table th,
    .phrases-table td {
        padding: 10px 14px;
        font-size: 0.875rem;
    }

    /* Ensure all touch targets are at least 44px */
    .action-btn {
        width: 44px;
        height: 44px;
    }

    .tool-chip {
        padding: 10px 18px;
        min-height: 44px;
    }

    .nav-list > li > a,
    .dropdown-toggle {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .cookie-btn {
        min-height: 44px;
        padding: 12px 24px;
    }

    .translate-btn {
        min-height: 48px;
    }

    .lang-card {
        min-height: 44px;
    }
}

/* ==========================================================================
   27. RESPONSIVE — 480px (small phones)
   ========================================================================== */

@media (max-width: 480px) {
    h1 {
        font-size: 1.35rem;
    }

    h2 {
        font-size: 1.15rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .lang-grid {
        grid-template-columns: 1fr;
    }

    .page-404 .error-code {
        font-size: 4rem;
    }

    .post-meta {
        flex-direction: column;
        gap: 8px;
    }

    .translator-textarea {
        min-height: 120px;
        padding: 12px;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }

    .lang-select {
        width: 100%;
    }

    .translate-btn {
        font-size: 0.9375rem;
    }

    .tools-bar {
        padding: 12px 0;
    }

    .breadcrumb-list {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   28. PRINT STYLES
   ========================================================================== */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .site-header,
    .site-footer,
    .announcement-bar,
    .cookie-consent,
    .adsense-container,
    .mobile-menu-toggle,
    .theme-toggle,
    .tools-bar,
    .translate-btn,
    .swap-btn,
    .panel-actions,
    .action-btn,
    .skip-link,
    .breadcrumb {
        display: none !important;
    }

    main {
        padding-top: 0 !important;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }

    a[href^="#"]::after,
    a[href^="javascript:"]::after {
        content: "";
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    p {
        orphans: 3;
        widows: 3;
    }

    .translator-panels {
        border: 1px solid #ccc;
    }

    .translator-panel {
        border: 1px solid #ccc;
        width: 100% !important;
    }

    .translator-textarea {
        border: 1px solid #ccc !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .features-grid,
    .posts-grid,
    .lang-grid,
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   PROFESSIONAL DESIGN ENHANCEMENTS
   ========================================================================== */

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 50%, #f8f9fa 100%);
    padding: 48px 0 24px;
    text-align: center;
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #1a1f2e 0%, #1a2744 50%, #1e1e1e 100%);
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary) 0%, #4a9af5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

/* --- Translator Widget Enhancements --- */
.translator-panels {
    box-shadow: 0 4px 24px rgba(26, 115, 232, 0.08), 0 1px 4px rgba(0,0,0,0.06);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(26, 115, 232, 0.12);
}

[data-theme="dark"] .translator-panels {
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    border-color: var(--border);
}

.panel-header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.translator-textarea {
    font-size: 1.0625rem;
    line-height: 1.7;
}

.translator-textarea:focus {
    background: rgba(26, 115, 232, 0.02);
}

.translate-btn {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
    border-radius: var(--radius-md);
    font-size: 1.0625rem;
    letter-spacing: 0.02em;
    height: 52px;
}

.translate-btn:hover {
    background: linear-gradient(135deg, #1557b0 0%, #0d47a1 100%);
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.4);
    transform: translateY(-1px);
}

.translate-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(26, 115, 232, 0.3);
}

.translator-footer {
    margin-top: 16px;
    text-align: center;
}

.keyboard-hint {
    display: block;
    margin-top: 10px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.panel-body {
    position: relative;
}

/* --- Swap Button Enhancement --- */
.swap-btn {
    width: 48px;
    height: 48px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.swap-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.3);
}

/* --- Action Buttons Enhancement --- */
.action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
}

.action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* --- Tools Bar Enhancement --- */
.tools-bar {
    background: var(--bg-primary);
    border: none;
    padding: 20px 0;
}

.tool-chip {
    padding: 10px 20px;
    font-size: 0.875rem;
    border-radius: 100px;
    font-weight: 500;
    box-shadow: var(--shadow-xs);
}

.tool-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* --- Feature Cards Enhancement --- */
.features-section {
    background: var(--bg-secondary);
    padding: 72px 0;
}

.features-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card {
    border: none;
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    box-shadow: var(--shadow-sm);
    background: var(--bg-widget);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.feature-card .feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    font-size: 1.75rem;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(26, 115, 232, 0.08) 100%);
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* --- Language Grid Enhancement --- */
.lang-grid-section {
    padding: 64px 0;
}

.lang-grid-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 40px;
}

.lang-card {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
}

.lang-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.12);
}

.lang-card .lang-flag {
    font-size: 1.75rem;
}

/* --- FAQ Enhancement --- */
.faq-section {
    padding: 64px 0;
    background: var(--bg-secondary);
}

.faq-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 40px;
}

.faq-item {
    background: var(--bg-widget);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-item:first-child {
    border-top: 1px solid var(--border);
}

.faq-question {
    padding: 20px 24px;
    font-size: 1rem;
}

.faq-answer {
    padding: 0 24px 20px;
}

.faq-question.active {
    color: var(--primary);
}

/* --- Footer Enhancement --- */
.site-footer {
    background: linear-gradient(180deg, #1a1d23 0%, #131518 100%);
    padding: 56px 0 0;
    margin-top: 0;
}

.footer-grid {
    padding-bottom: 48px;
    gap: 40px;
}

.footer-col h3 {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8ab4f8;
    margin-bottom: 20px;
}

.footer-col ul {
    gap: 12px;
}

.footer-col ul li a {
    font-size: 0.875rem;
    color: #9aa0a6;
    transition: color 0.2s, padding-left 0.2s;
}

.footer-col ul li a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-bottom {
    justify-content: center;
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.8125rem;
    color: #5f6368;
}

/* --- Phrases Table Enhancement --- */
.phrases-table {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.phrases-table thead {
    background: linear-gradient(135deg, var(--primary) 0%, #1557b0 100%);
}

.phrases-table thead th {
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 14px 20px;
}

.phrases-table tbody td {
    padding: 14px 20px;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--border);
}

.phrases-table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

.phrases-table tbody tr:hover {
    background: var(--primary-light);
}

.phrases-table .pronunciation {
    font-style: italic;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* --- Blog Cards Enhancement --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.post-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s, box-shadow 0.25s;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.post-card a {
    display: block;
    padding: 28px;
    text-decoration: none;
}

.post-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
}

.post-card p {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.post-card-meta {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* --- Breadcrumbs Enhancement --- */
.breadcrumbs {
    padding: 16px 0;
    margin-bottom: 8px;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
}

.breadcrumb-list li + li::before {
    content: "›";
    margin: 0 8px;
    color: var(--text-tertiary);
    font-size: 1rem;
}

.breadcrumb-list a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.breadcrumb-list a:hover {
    color: var(--primary);
}

/* --- Cookie Consent Enhancement --- */
.cookie-consent {
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    border-top: none;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.95);
}

[data-theme="dark"] .cookie-consent {
    background: rgba(30,30,30,0.95);
}

.cookie-btn.cookie-accept {
    background: var(--primary);
    color: #fff;
    padding: 10px 28px;
    border-radius: 100px;
    font-weight: 600;
    transition: all 0.2s;
}

.cookie-btn.cookie-accept:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

/* --- Related Translators Enhancement --- */
.related-translators {
    padding: 48px 0;
}

.related-translators h2 {
    text-align: center;
    margin-bottom: 32px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.related-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-widget);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.related-card:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}

.related-card .lang-flag {
    font-size: 1.5rem;
}

/* --- Upload/Tool Zone Enhancement --- */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    background: var(--bg-secondary);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.01);
}

.upload-zone svg {
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.upload-zone p {
    margin-bottom: 4px;
}

.upload-zone .upload-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.tool-output {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 16px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin: 16px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* --- Page Subtitle --- */
.page-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* --- Translator Page Layout --- */
.translator-page {
    padding-bottom: 0;
}

.translator-page .container {
    padding-top: 16px;
}

.translator-page h1 {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 8px;
}

/* --- Smooth transitions everywhere --- */
* {
    -webkit-tap-highlight-color: transparent;
}

::selection {
    background: rgba(26, 115, 232, 0.2);
    color: var(--text-primary);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* --- AdSense container spacing --- */
.adsense-container {
    margin: 32px auto;
    text-align: center;
    min-height: 90px;
}
