/* Text2File Pro - PageSpeed 100 Optimized CSS */
/* NO TRANSITIONS - NO ANIMATIONS - NO CLS */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #0ea5e9;
    --success: #22c55e;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-lg: 16px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main content - prevent CLS */
.main {
    flex: 1;
    padding-bottom: 60px;
}

/* Header - Fixed height to prevent CLS */
.header {
    background: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--gray-100);
    height: 70px;
    min-height: 70px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--dark);
}

.logo-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.nav {
    display: flex;
    align-items: center;
    gap: 30px;
    min-height: 40px;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--primary);
}

/* Language Selector - Fixed dimensions */
.lang-selector {
    position: relative;
    min-width: 120px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    min-height: 40px;
}

.lang-btn:hover {
    background: var(--gray-200);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
    border: 1px solid var(--gray-100);
}

.lang-selector:hover .lang-dropdown,
.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--gray-700);
}

.lang-option:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.lang-option:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.lang-option.active {
    background: var(--primary);
    color: #fff;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
}

/* Hero Section - Fixed dimensions */
.hero {
    background: var(--gradient);
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
    min-height: 280px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    min-height: 72px;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
    min-height: 60px;
}

/* Converter Card - Fixed dimensions */
.converter-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    margin-top: -60px;
    position: relative;
    z-index: 10;
    min-height: 500px;
}

.converter-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.text-input {
    width: 100%;
    min-height: 200px;
    height: 200px;
    padding: 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.text-input::placeholder {
    color: var(--gray-400);
}

.text-stats {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--gray-500);
    min-height: 24px;
}

.text-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Format Selector - Fixed dimensions */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.format-option {
    position: relative;
}

.format-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.format-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    min-height: 100px;
    height: 100px;
}

.format-label:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.format-option input:checked + .format-label {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.format-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 10px;
    font-size: 1.2rem;
}

.format-option input:checked + .format-label .format-icon {
    background: var(--primary);
    color: #fff;
}

.format-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.format-ext {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Buttons - NO transitions */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    min-height: 40px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--gray-600);
    cursor: pointer;
}

.action-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* Result Section */
.result-section {
    display: none;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
    border-radius: var(--radius);
    margin-top: 24px;
}

.result-section.active {
    display: block;
}

.result-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #fff;
    font-size: 2rem;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 10px;
}

.result-info {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.result-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 24px;
}

.result-meta-item {
    text-align: center;
}

.result-meta-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.result-meta-label {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* Features Section */
.features {
    padding: 100px 0;
    background: #fff;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    padding: 32px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    min-height: 200px;
}

.feature-card:hover {
    background: #fff;
    border-color: var(--gray-200);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #fff;
    font-size: 1.5rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.feature-desc {
    color: var(--gray-600);
    line-height: 1.7;
}

/* FAQ Section */
.faq {
    padding: 100px 0;
    background: var(--gray-50);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: #fff;
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.faq-question {
    width: 100%;
    padding: 24px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
}

.faq-question:hover {
    color: var(--primary);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--gray-400);
}

.faq-answer {
    display: none;
    padding: 0 24px 24px;
    color: var(--gray-600);
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

/* Footer */
.footer {
    background: var(--dark);
    color: #fff;
    padding: 60px 0 30px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.footer-desc {
    color: var(--gray-400);
    line-height: 1.7;
}

.footer-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 30px;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* Ad Spaces */
.ad-space {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin: 20px 0;
    min-height: 90px;
}

/* Responsive */
@media (max-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 60px 0 80px;
        min-height: 200px;
    }
    
    .hero-title {
        font-size: 2rem;
        min-height: 48px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        min-height: 48px;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        gap: 15px;
    }
    
    .nav.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .converter-card {
        padding: 24px;
        min-height: 400px;
    }
    
    .format-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .format-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* Print */
@media print {
    .header, .footer, .ad-space {
        display: none;
    }
}
