/* ========================================
   lexprep Web Application - Global Styles
/* CSS Variables */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    
    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --gradient-bg: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0f0f23 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    /* Spacing */
    --container-max: 1200px;
    --nav-height: 70px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-bg);
    color: var(--gray-100);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-bg);
    z-index: -2;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gray-100);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    font-size: 1.5rem;
}

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

.nav-logo .logo-img {
    height: 63px;
}

.footer-brand .logo-img {
    height: 92px;
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-link {
    display: block;
    padding: 10px 18px;
    color: var(--gray-400);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: all var(--transition-normal);
}

.nav-link:hover {
    color: var(--gray-100);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--gray-100);
    background: rgba(99, 102, 241, 0.2);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--gray-400);
    transition: all var(--transition-normal);
}

/* Hero Section */
.hero {
    padding: calc(var(--nav-height) + 60px) 0 60px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-light);
    margin-bottom: 24px;
}

.hero-tagline {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 500;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--gray-100);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: 1.3rem;
    color: var(--gray-300);
    font-weight: 400;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--gray-400);
    max-width: 700px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero-subtitle strong {
    color: var(--gray-200);
    font-weight: 600;
}

/* Typewriter Animation */
.typewriter-container {
    display: inline-block;
    position: relative;
}

.typewriter-word {
    display: inline;
    font-family: 'JetBrains Mono', monospace;
}

.typewriter-cursor {
    display: inline-block;
    color: var(--primary);
    font-weight: 400;
    animation: cursorBlink 1s infinite;
    margin-left: 2px;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.feature-tag {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-300);
    cursor: default;
    transition: all var(--transition-normal);
}

.feature-tag:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-3px);
    color: var(--gray-100);
}

.feature-tag[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 22px;
    background: var(--gray-800);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--gray-300);
    min-width: 220px;
    max-width: 340px;
    white-space: normal;
    text-align: center;
    line-height: 1.6;
    z-index: 100;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.15);
}

@keyframes tooltipFadeIn {
    to { opacity: 1; }
}

.feature-icon {
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    padding: 40px 0 80px;
}

/* Cards */
.tool-card,
.results-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    margin-bottom: 32px;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-100);
    margin-bottom: 8px;
}

.card-header p {
    color: var(--gray-400);
    font-size: 0.95rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 32px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-200);
    margin-bottom: 16px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.label-hint {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* Language & Tool Grids */
.language-grid,
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.language-btn,
.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
}

.language-btn:hover,
.tool-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.language-btn.active,
.tool-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.language-btn .flag-icon {
    width: 36px;
    height: 36px;
    border-radius: 4px;
}

.language-btn .name,
.tool-btn .name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-200);
}

.tool-btn .description {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.placeholder-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
    font-style: italic;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: rgba(0, 0, 0, 0.1);
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload-area.has-file {
    border-style: solid;
    border-color: var(--secondary);
    padding: 20px;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    margin-bottom: 16px;
    color: var(--gray-500);
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gray-300);
    margin-bottom: 4px;
}

.upload-subtext {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.upload-formats {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.upload-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.file-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.file-name {
    font-weight: 600;
    color: var(--gray-200);
}

.file-size {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.remove-file {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.remove-file:hover {
    background: rgba(239, 68, 68, 0.2);
}

.word-column-select {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.word-column-select label {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.help-tooltip {
    position: relative;
    cursor: help;
    color: var(--gray-500);
    margin-left: 8px;
    display: inline-flex;
    vertical-align: middle;
}

.help-tooltip:hover {
    color: var(--primary-light);
}

.help-tooltip[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 16px;
    background: var(--gray-800);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--gray-300);
    width: 260px;
    text-align: left;
    z-index: 100;
    line-height: 1.5;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

/* Textarea */
.textarea-wrapper {
    position: relative;
}

.words-input {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    color: var(--gray-100);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    resize: vertical;
    transition: all var(--transition-normal);
}

.words-input::placeholder {
    color: var(--gray-600);
}

.words-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.word-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--gray-400);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: white !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    text-decoration: none;
}

a.btn-primary {
    color: white !important;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gray-200);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: translateY(-2px);
}

.btn-process {
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
}

.btn-process.loading {
    pointer-events: none;
    opacity: 0.7;
}

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

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Cancel Button */
.btn-cancel {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: none;
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
}

.btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
    background: linear-gradient(135deg, #5a6268 0%, #545b62 100%);
}

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

/* Accuracy Note */
.accuracy-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #ffea00;
}

/* Progress Indicator */
.progress-container {
    margin-top: 24px;
    padding: 24px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    animation: progressFadeIn 0.3s ease;
}

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

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

.progress-title {
    font-weight: 600;
    color: var(--gray-200);
    font-size: 1rem;
}

.progress-percent {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-light);
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShimmer 1.5s infinite;
}

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

.progress-stages {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.progress-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.progress-stage.active {
    opacity: 1;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.progress-stage.completed {
    opacity: 1;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

.progress-stage.completed .stage-icon {
    color: var(--secondary);
}

.stage-icon {
    font-size: 1.5rem;
}

.stage-text {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-align: center;
    font-weight: 500;
}

.progress-stage.active .stage-text,
.progress-stage.completed .stage-text {
    color: var(--gray-200);
}

@media (max-width: 480px) {
    .progress-stages {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Results Section */
.results-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.results-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.format-select {
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--gray-200);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.format-select:focus {
    outline: none;
    border-color: var(--primary);
}

.results-table-wrapper {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.results-table th,
.results-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.results-table th {
    font-weight: 600;
    color: var(--gray-300);
    background: rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
}

.results-table th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.results-table th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.results-table td {
    color: var(--gray-200);
    font-family: 'JetBrains Mono', monospace;
}

.results-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.results-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    padding: 60px 0 30px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    text-align: center;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-text {
    color: var(--gray-500);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 24px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-400);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-normal);
}

.footer-link:hover {
    color: var(--primary-light);
}

.footer-link .icon {
    width: 18px;
    height: 18px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom p {
    color: var(--gray-600);
    font-size: 0.85rem;
}

.footer-powered {
    color: var(--gray-600);
    font-size: 0.8rem;
    margin-top: 8px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--gray-800);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--secondary);
}

.toast.error {
    border-color: #ef4444;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-message {
    font-size: 0.95rem;
    color: var(--gray-200);
}

/* Page Content Styles (for other pages) */
.page-header {
    padding: calc(var(--nav-height) + 60px) 0 40px;
    text-align: center;
}

.page-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 16px;
}

.page-subtitle {
    color: var(--gray-400);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.content-section {
    padding: 40px 0;
}

.content-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.content-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-100);
}

.content-card p {
    color: var(--gray-400);
    line-height: 1.8;
    margin-bottom: 16px;
}

.content-card ul {
    list-style: none;
    margin: 16px 0;
}

.content-card ul > li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: var(--gray-300);
}

.content-card ul > li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.content-card ol > li {
    margin-bottom: 12px;
    color: var(--gray-300);
}

.content-card a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.content-card a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Code Block */
.code-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--gray-300);
}

/* Author Card */
.author-card {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 40px;
}

.author-avatar {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    flex-shrink: 0;
    overflow: hidden;
}

.author-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.author-info h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.author-info p {
    color: var(--gray-400);
    margin-bottom: 16px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--gray-400);
    transition: all var(--transition-normal);
}

.social-link:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--primary-light);
}

/* Library Cards */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.library-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

.library-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.library-card h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--gray-100);
}

.library-card .tag {
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-light);
}

/* Flag icons */
.flag-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 3px;
}

.library-card p {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.library-card .license {
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        pointer-events: none;
        visibility: hidden;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(15, 15, 35, 0.98);
        flex-direction: column;
        padding: 20px;
        gap: 4px;
        transform: translateY(-100%);
        opacity: 0;
        transition: all var(--transition-normal);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .tool-card,
    .results-card,
    .content-card {
        padding: 24px;
    }
    
    .author-card {
        flex-direction: column;
        text-align: center;
    }
    
    .results-card .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-actions {
        width: 100%;
    }
    
    .format-select {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .language-grid,
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-process {
        padding: 16px;
        font-size: 1rem;
    }
}

/* Admin Page Styles */
.admin-header {
    padding: calc(var(--nav-height) + 40px) 0 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: 8px;
}

.admin-login {
    max-width: 400px;
    margin: 0 auto;
}

.admin-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    color: var(--gray-100);
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 16px;
}

.admin-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .content-card li {
    padding-left: 0;
    padding-right: 24px;
}

[dir="rtl"] .content-card li::before {
    left: auto;
    right: 0;
    content: '←';
}

/* Sampling page styles */
.tool-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
    padding: 8px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.tool-tab {
    flex: 1;
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}
.tool-tab:hover {
    color: #e2e8f0;
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}
.tool-tab.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    color: #fff;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.tool-tab.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
}
.tool-tab .tab-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}
.tool-tab.active .tab-icon {
    opacity: 1;
}
.tool-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}
.tool-panel.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.mode-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.mode-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
}
.mode-btn.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}
.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
    cursor: pointer;
    color: #64748b;
    font-size: 0.9rem;
}
.advanced-toggle:hover {
    color: #94a3b8;
}
.advanced-toggle svg {
    transition: transform 0.2s;
}
.advanced-toggle.open svg {
    transform: rotate(180deg);
}
.advanced-options {
    display: none;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}
.advanced-options.open {
    display: block;
}
.range-builder {
    margin-top: 1rem;
}
.range-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.range-row .range-input-wrap {
    flex: 1;
    min-width: 100px;
    max-width: 150px;
}
.range-row .range-count-wrap {
    width: 80px;
    display: none;
}
.range-row.show-fixed .range-count-wrap {
    display: block;
}
.range-row input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.allocation-info {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid #3b82f6;
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.8rem;
    color: #94a3b8;
}
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.5rem;
    cursor: pointer;
}
.checkbox-option:hover {
    background: rgba(139, 92, 246, 0.1);
}
.checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
}
.checkbox-option label {
    color: #a5b4fc;
    font-size: 0.9rem;
    cursor: pointer;
}
.weights-panel {
    display: none;
    margin-top: 0.75rem;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 0.5rem;
}
.weights-panel.open {
    display: block;
}
.weights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}
.weight-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.weight-item label {
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
}
.weight-item input {
    width: 60px;
    padding: 0.4rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.25rem;
    color: #e2e8f0;
    font-size: 0.85rem;
}
.range-row input::placeholder {
    color: #64748b;
}
.remove-range-btn {
    padding: 0.6rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
}
.remove-range-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}
.add-range-btn {
    padding: 0.6rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.add-range-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}
.help-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}
.help-link:hover {
    color: #94a3b8;
}
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open {
    display: flex;
}
.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-header h3 {
    color: #f1f5f9;
    margin: 0;
}
.modal-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
    line-height: 1;
}
.modal-close:hover {
    color: #94a3b8;
}
.modal-content p, .modal-content li {
    color: #94a3b8;
    line-height: 1.7;
}
.modal-content h4 {
    color: #e2e8f0;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.modal-content code {
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #a5f3fc;
}
.file-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 0.5rem;
    color: #60a5fa;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
.warning-box {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    padding: 1rem;
    border-radius: 0.5rem;
}
.warning-box h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}
.warning-box ul {
    margin: 0;
    padding-left: 1.5rem;
    font-size: 0.9rem;
    color: #fcd34d;
}

/* Accuracy Page Specific Styles */
.accuracy-summary {
    display: grid;
    gap: 16px;
    margin-bottom: 32px;
}

.accuracy-row {
    display: grid;
    grid-template-columns: 1fr 1fr 120px 1fr;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    align-items: center;
    transition: all 0.2s ease;
}

.accuracy-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.accuracy-row.header {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    font-weight: 600;
    color: var(--gray-200);
}

.tool-name {
    font-weight: 500;
    color: var(--gray-100);
}

.tool-library {
    color: var(--gray-400);
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
}

.accuracy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.accuracy-badge.high {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.accuracy-badge.medium {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.accuracy-badge.estimate {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.source-link {
    color: var(--gray-400);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.source-link:hover {
    color: var(--primary-light);
}

.tool-detail-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.tool-detail-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

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

.tool-detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-detail-title h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--gray-100);
}

.tool-detail-body {
    color: var(--gray-400);
    font-size: 0.95rem;
    line-height: 1.6;
}

.tool-detail-body p {
    margin-bottom: 12px;
}

.tool-detail-body strong {
    color: var(--gray-200);
}

.method-list {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
    padding-left: 36px;
    margin: 12px 0;
    list-style: decimal;
}

ul.method-list {
    list-style: disc;
    padding-left: 36px;
}

.method-list li {
    margin-bottom: 8px;
    color: var(--gray-300);
    padding-left: 0;
}

.method-list li::before {
    content: none;
}

.method-list li:last-child {
    margin-bottom: 0;
}

.benchmark-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.benchmark-table th,
.benchmark-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.benchmark-table th {
    color: var(--gray-300);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
}

.benchmark-table td {
    color: var(--gray-400);
}

.benchmark-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.note-box {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.note-box svg {
    flex-shrink: 0;
    color: #fbbf24;
}

.note-box p {
    margin: 0;
    color: var(--gray-300);
    font-size: 0.9rem;
}

.language-flag {
    font-size: 1.5rem;
    line-height: 1;
}

@media (max-width: 768px) {
    .accuracy-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .accuracy-row.header {
        display: none;
    }

    .tool-detail-header {
        flex-direction: column;
    }
}
