/* Performance: Use modern CSS features for better rendering */
:root {
    --primary-color: #007cba;
    --secondary-color: #666;
    --background-color: #f9f9f9;
    --border-color: #ddd;
    --text-color: #333;
    --success-color: #1e7e34;
    --warning-color: #e0a800;
    --danger-color: #dc3545;
}

/* Performance: Optimize rendering with contain */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--background-color);
    /* Performance optimizations */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Performance: Optimize font loading - Commented out as font file doesn't exist */
/* @font-face {
    font-family: 'OptimizedFont';
    src: url('/assets/fonts/optimized-font.woff2') format('woff2');
    font-display: swap;
} */

/* Performance: Optimize images */
img {
    max-width: 100%;
    height: auto;
    /* Optimize rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Performance: Optimize critical rendering path */
.hero, .main-content, .upload-area {
    contain: layout style;
}

/* Performance: Optimize animations with will-change */
.btn, .cta-buttons .btn, .urgent-buttons .btn, .filename-buttons .btn {
    will-change: transform;
}

/* Performance: Optimize animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

/* Accessibility: Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
}

/* Language Header */
.language-header {
    text-align: center;
    margin: 20px 0 15px 0;
}

.language-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .language-header h2 {
        font-size: 1.25rem;
    }
}

.skip-link:focus {
    top: 6px;
}

/* Accessibility: Focus indicators */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Accessibility: High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --text-color: #000000;
        --background-color: #ffffff;
        --border-color: #000000;
    }
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Performance: Prevent layout shift with min-heights */
.ad-container {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

/* Performance: Optimize animations with transform */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading[hidden] {
    display: none !important;
}

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

/* Language Switcher */
.lang-switcher {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Performance: Use will-change for elements that animate */
.lang-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
    will-change: background-color;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.lang-btn[aria-pressed="true"],
.lang-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.lang-btn:hover {
    background-color: #f0f0f0;
}

.lang-btn[aria-pressed="true"]:hover,
.lang-btn.active:hover {
    background-color: #005a87;
}

/* Ensure anchor links have proper styling */
.lang-btn {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

/* Performance: Lazy load images */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Logo optimization styles */
.logo {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Responsive logo sizing */
@media (max-width: 768px) {
    .logo {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .logo {
        max-width: 120px;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .ad-sidebar {
        display: none;
    }
    
    .app-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .header {
        padding: 1rem 0;
    }
    
    .header__keywords {
        font-size: 1rem;
        color: var(--text-muted);
        text-align: center;
        margin-bottom: 2rem;
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.6;
        font-weight: 500;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    /* Improved mobile typography */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
        line-height: 1.4;
    }
    
    /* Mobile-friendly tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .files-table {
        min-width: 600px;
    }
    
    /* Mobile-friendly upload area */
    .upload-area {
        padding: 2rem 1rem;
        min-height: 200px;
    }
    
    .upload-content h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile-friendly language switcher */
    .lang-switcher {
        gap: 4px;
        margin: 0.5rem 0;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
}

/* Desktop layout */
@media (min-width: 769px) {
    .ad-mobile-anchor {
        display: none;
    }
    
    .app-grid {
        display: grid;
        grid-template-columns: 1fr 320px;
        gap: 40px;
    }
}

/* Performance: Reduce paint complexity */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    contain: layout;
}

.files-table th,
.files-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

/* Button styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    will-change: background-color;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #005a87;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

/* Template styles */
.templates-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.template-controls {
    margin-bottom: 15px;
}

.template-config {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.sample-preview {
    background: #e9ecef;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.preview-text {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-color);
    background: white;
    padding: 8px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

/* Performance: Optimize rendering of upload area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
    transition: border-color 0.2s ease;
    contain: layout;
}

.upload-area:hover {
    border-color: var(--primary-color);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #f0f8ff;
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Footer */
.footer {
    background-color: #333;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

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

.footer a {
    color: #e6e6e6;
    text-decoration: none;
}

.footer a:hover {
    color: white;
}

/* Cross-promotion card */
.tool-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.tool-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

/* Status messages */
.status-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.status-message {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease-out;
}

.status-info {
    background-color: #e3f2fd;
    color: #0d47a1;
    border-left: 4px solid #1976d2;
}

.status-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.status-warning {
    background-color: #fff3e0;
    color: #e65100;
    border-left: 4px solid #f57c00;
}

.status-error {
    background-color: #ffebee;
    color: #b71c1c;
    border-left: 4px solid #d32f2f;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced rule interface */
.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.rule-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.rule-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.rule-item.drag-over {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.rule-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 60px;
}

.rule-drag-handle {
    cursor: grab;
    background: none;
    border: none;
    font-size: 16px;
    color: #6c757d;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.rule-drag-handle:hover {
    background: #dee2e6;
    color: #495057;
}

.rule-drag-handle:active {
    cursor: grabbing;
}

.rule-enable {
    display: flex;
    align-items: center;
    margin: 0;
}

.rule-priority {
    font-size: 12px;
    color: #6c757d;
    background: #fff;
    padding: 2px 6px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    min-width: 20px;
    text-align: center;
}

.rule-input-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rule-advanced-options {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-top: 8px;
}

.rule-segment-control {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-top: 8px;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.form-row label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    margin: 0;
}

.form-row input,
.form-row select {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.numbering-options,
.case-options,
.metadata-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

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

.undo-controls {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.rule-type {
    min-width: 150px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.rule-input-container {
    flex: 1;
}

.rule-value {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.rule-options {
    margin-top: 5px;
    font-size: 12px;
}

.rule-options label {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Diff highlighting */
.new-name-display {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: inline-block;
    min-width: 200px;
}

mark {
    background-color: #fff3cd;
    color: #6c5b00;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Button enhancements */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

/* Upload area enhancements */
.upload-area {
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-area:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* CTA Section Styles */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.05"/><circle cx="10" cy="90" r="0.5" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.cta-section h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cta-section p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-buttons .btn-primary {
    background: #fff;
    color: #667eea;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.cta-buttons .btn-primary:hover {
    background: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.cta-buttons .btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.7);
}

.cta-buttons .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
    transform: translateY(-2px);
}

.cta-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.cta-stats .stat {
    text-align: center;
}

.cta-stats .stat strong {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cta-stats .stat span {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

@media (max-width: 768px) {
    .cta-section h2 {
        font-size: 2.2rem;
    }
    
    .cta-section p {
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .cta-stats {
        gap: 2rem;
    }
    
    .cta-stats .stat strong {
        font-size: 2rem;
    }
}

/* Urgent CTA Section Styles */
.urgent-cta-section {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #c44569 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.urgent-cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="urgent-grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1.5" fill="white" opacity="0.1"/><circle cx="80" cy="80" r="1" fill="white" opacity="0.15"/><circle cx="40" cy="60" r="0.8" fill="white" opacity="0.08"/><circle cx="70" cy="30" r="0.5" fill="white" opacity="0.12"/></pattern></defs><rect width="100" height="100" fill="url(%23urgent-grain)"/></svg>');
    opacity: 0.4;
}

.urgent-cta-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.urgent-note {
    flex: 0 0 300px;
}

.note-paper {
    background: #fffacd;
    color: #333;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transform: rotate(-3deg);
    border: 2px solid #ffd700;
    position: relative;
    font-family: 'Courier New', monospace;
}

.note-paper::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: #ffd700;
    border-radius: 8px;
    z-index: -1;
}

.note-paper h2 {
    color: #d63031;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: bold;
    text-decoration: underline;
}

.note-paper p {
    margin: 0.8rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.note-paper .highlight {
    font-weight: bold;
    color: #2d3436;
    font-size: 1.2rem;
}

.urgent-message {
    flex: 1;
    text-align: left;
}

.urgent-message h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.urgent-message p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    line-height: 1.6;
}

.urgent-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.urgent-buttons .btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.urgent-buttons .btn-danger {
    background: #fff;
    color: #e74c3c;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.urgent-buttons .btn-danger:hover {
    background: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.urgent-buttons .btn-outline-light {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.7);
}

.urgent-buttons .btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
    transform: translateY(-2px);
}

.urgent-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

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

.urgent-stat strong {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.urgent-stat span {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

@media (max-width: 968px) {
    .urgent-cta-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .urgent-note {
        flex: none;
        order: 2;
    }
    
    .urgent-message {
        order: 1;
        text-align: center;
    }
    
    .urgent-message h3 {
        font-size: 2rem;
    }
    
    .urgent-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .urgent-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .urgent-stats {
        justify-content: center;
        gap: 1.5rem;
    }
    
    .urgent-stat strong {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .urgent-cta-section {
        padding: 60px 0;
    }
    
    .note-paper {
        padding: 1.5rem;
        transform: rotate(-1deg);
    }
    
    .note-paper h2 {
        font-size: 1.5rem;
    }
    
    .note-paper p {
        font-size: 1rem;
    }
    
    .urgent-message h3 {
        font-size: 1.8rem;
    }
    
    .urgent-message p {
        font-size: 1.1rem;
    }
}

/* Filename CTA Section Styles */
.filename-cta-section {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 50%, #6c5ce7 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.filename-cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="filename-grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="15" cy="15" r="1" fill="white" opacity="0.1"/><circle cx="85" cy="85" r="1.2" fill="white" opacity="0.15"/><circle cx="50" cy="50" r="0.6" fill="white" opacity="0.08"/><circle cx="25" cy="75" r="0.8" fill="white" opacity="0.12"/><circle cx="75" cy="25" r="0.4" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23filename-grain)"/></svg>');
    opacity: 0.3;
}

.filename-cta-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.filename-visual {
    flex: 0 0 350px;
}

.file-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: rotate(2deg);
    position: relative;
}

.file-card::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #ddd, #f0f0f0);
    border-radius: 12px;
    z-index: -1;
}

.folder-icon {
    position: relative;
    width: 60px;
    height: 50px;
    margin: 0 auto 1.5rem;
}

.folder-body {
    width: 60px;
    height: 40px;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    border-radius: 4px 4px 8px 8px;
    position: absolute;
    bottom: 0;
}

.folder-tab {
    width: 25px;
    height: 8px;
    background: linear-gradient(135deg, #0984e3, #74b9ff);
    border-radius: 4px 4px 0 0;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.messy-filename {
    text-align: center;
    font-family: 'Courier New', monospace;
}

.filename-line {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.2;
    margin: 0.2rem 0;
    font-weight: 500;
}

.filename-line:first-child {
    color: #555;
}

.filename-line:last-child {
    color: #777;
}

.filename-message {
    flex: 1;
    text-align: left;
}

.filename-message h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.filename-message p:first-of-type {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    font-weight: 600;
}

.filename-message h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.filename-message p:last-of-type {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    line-height: 1.6;
}

.filename-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filename-buttons .btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filename-buttons .btn-info {
    background: #fff;
    color: #0984e3;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.filename-buttons .btn-info:hover {
    background: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.filename-buttons .btn-outline-info {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.7);
}

.filename-buttons .btn-outline-info:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
    transform: translateY(-2px);
}

.filename-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

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

.filename-stat strong {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.filename-stat span {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

@media (max-width: 968px) {
    .filename-cta-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .filename-visual {
        flex: none;
        order: 2;
    }
    
    .filename-message {
        order: 1;
        text-align: center;
    }
    
    .filename-message h2 {
        font-size: 2.2rem;
    }
    
    .filename-message h3 {
        font-size: 1.8rem;
    }
    
    .filename-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .filename-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .filename-stats {
        justify-content: center;
        gap: 1.5rem;
    }
    
    .filename-stat strong {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .filename-cta-section {
        padding: 60px 0;
    }
    
    .file-card {
        padding: 1.5rem;
        transform: rotate(1deg);
    }
    
    .folder-icon {
        width: 50px;
        height: 40px;
    }
    
    .folder-body {
        width: 50px;
        height: 32px;
    }
    
    .folder-tab {
        width: 20px;
        height: 6px;
    }
    
    .filename-line {
        font-size: 0.8rem;
    }
    
    .filename-message h2 {
        font-size: 2rem;
    }
    
    .filename-message h3 {
        font-size: 1.6rem;
    }
    
    .filename-message p {
        font-size: 1.1rem;
    }
}

/* SEO Section */
.seo-section {
    background: white;
    padding: 40px 0;
    margin: 40px 0;
}

.seo-section h2 {
    color: var(--text-color);
    font-size: 28px;
    margin-bottom: 20px;
    text-align: center;
}

.seo-section h3 {
    color: var(--primary-color);
    font-size: 22px;
    margin: 30px 0 15px 0;
}

.seo-section p {
    color: var(--text-color);
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 16px;
}

.seo-section ul {
    list-style: none;
    padding: 0;
}

.seo-section li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: var(--text-color);
    line-height: 1.6;
}

.seo-section li:before {
    content: "✓";
    color: var(--success-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 20px;
}

/* Template management styles */
.template-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.template-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.template-info h4 {
    margin: 0 0 5px 0;
    color: var(--text-color);
}

.template-info p {
    margin: 0 0 5px 0;
    color: #6c757d;
    font-size: 14px;
}

.template-info small {
    color: #6c757d;
    font-size: 12px;
}

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

.template-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Regex builder styles */
.regex-builder {
    max-width: 600px;
}

.builder-header {
    margin-bottom: 20px;
}

.builder-header h3 {
    margin: 0 0 5px 0;
    color: var(--text-color);
}

.builder-header p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.pattern-selector {
    margin-bottom: 20px;
}

.pattern-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.pattern-description {
    font-weight: 500;
    margin-bottom: 8px;
    color: #1976d2;
}

.pattern-example {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #bbdefb;
    font-size: 14px;
}

.custom-pattern {
    background: #fff3e0;
    border: 1px solid #ffcc02;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.test-section {
    background: #f3e5f5;
    border: 1px solid #ce93d8;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.test-result {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.test-result.test-success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.test-result.test-error {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #d32f2f;
}

.builder-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Undo history styles */
.undo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
}

.undo-operation {
    font-weight: 500;
    color: var(--text-color);
}

.undo-time {
    font-size: 12px;
    color: #6c757d;
}

.undo-files {
    font-size: 12px;
    color: #6c757d;
}

/* Template actions in sidebar */
.template-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.template-actions .btn {
    flex: 1;
    min-width: 80px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rule-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rule-controls {
        flex-direction: row;
        justify-content: space-between;
        min-width: auto;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .template-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .template-actions {
        justify-content: center;
    }
    
    .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .rules-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rules-actions {
        justify-content: center;
    }
}

/* Enhanced preview system styles */
.preview-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
}

.summary-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.stat {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #e9ecef;
    color: #495057;
}

.stat.changed {
    background: #d4edda;
    color: #155724;
}

.stat.unchanged {
    background: #f8f9fa;
    color: #6c757d;
}

.stat.conflict {
    background: #f8d7da;
    color: #721c24;
    font-weight: 500;
}

/* Status indicators */
.status-indicator {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
}

.status-conflict {
    background: #f8d7da;
    color: #721c24;
}

.status-changed {
    background: #d4edda;
    color: #155724;
}

.status-unchanged {
    background: #f8f9fa;
    color: #6c757d;
}

/* Row highlighting */
.conflict-row {
    background: #fff5f5 !important;
    border-left: 3px solid #dc3545;
}

.modified-row {
    background: #f8fff8 !important;
    border-left: 3px solid #28a745;
}

.conflict-row:hover {
    background: #ffe6e6 !important;
}

.modified-row:hover {
    background: #f0fff0 !important;
}

/* Enhanced diff highlighting */
.new-name-display {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
}

.new-name-display mark {
    background: #ffeb3b;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 500;
}

/* File table enhancements */
.file-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.file-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.file-table td {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.file-table tr:hover {
    background: #f8f9fa;
}

.file-table .original-name {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #6c757d;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-table .new-name {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-width: 200px;
}

.file-table .new-name-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.file-table .new-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.file-table .file-size {
    font-size: 12px;
    color: #6c757d;
    text-align: right;
    min-width: 80px;
}

.file-table .file-type {
    font-size: 12px;
    color: #6c757d;
    min-width: 100px;
}

.file-table .file-status {
    text-align: center;
    min-width: 100px;
}

/* Responsive table */
@media (max-width: 768px) {
    .file-table {
        font-size: 12px;
    }
    
    .file-table th,
    .file-table td {
        padding: 6px 4px;
    }
    
    .file-table .original-name,
    .file-table .new-name {
        max-width: 120px;
    }
    
    .summary-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Virtual scrolling styles */
.virtual-scroll-container {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
}

.virtual-scroll-spacer {
    pointer-events: none;
}

.virtual-scroll-viewport {
    pointer-events: auto;
}

.virtual-scroll-viewport tr {
    height: 40px;
    display: table-row;
}

.virtual-scroll-viewport td {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

/* Performance optimizations */
.file-table {
    contain: layout style;
}

.file-table tr {
    contain: layout style;
}

.new-name-input {
    will-change: transform;
}

.status-indicator {
    will-change: transform;
}

/* Large file set optimizations */
.large-file-set .file-table {
    font-size: 12px;
}

.large-file-set .file-table th,
.large-file-set .file-table td {
    padding: 6px 4px;
}

.large-file-set .new-name-input {
    font-size: 11px;
    padding: 2px 4px;
}

.large-file-set .status-indicator {
    font-size: 10px;
    padding: 1px 4px;
}

/* Progress indicators for large operations */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.progress-modal {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    min-width: 300px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    font-size: 14px;
    color: #6c757d;
    margin-top: 10px;
}

/* Cloud integration styles */
.cloud-options {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.cloud-option {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.cloud-option h4 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-size: 18px;
}

.cloud-option p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 14px;
}

.cloud-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cloud-buttons .btn {
    flex: 1;
    min-width: 150px;
}

/* Cloud status indicators */
.cloud-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 12px;
    background: #e9ecef;
    color: #6c757d;
}

.cloud-status.connected {
    background: #d4edda;
    color: #155724;
}

.cloud-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* Print styles */
@media print {
    .ad-container,
    .lang-switcher,
    .status-container,
    .modal-overlay,
    .progress-overlay {
        display: none !important;
    }
    
    .file-table {
        font-size: 10px;
    }
    
    .file-table th,
    .file-table td {
        padding: 4px 2px;
    }
}
