body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #f4f4f4 0%, #e0e0e0 100%);
    margin: 0;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: #ecf0f1;
}

/* Header Styles */
.header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.header.dark {
    background: #34495e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo h1 {
    margin: 0;
    font-size: 1.8em;
    color: #333;
    transition: color 0.3s ease;
}

.logo h1.dark {
    color: #ecf0f1;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 8px 16px;
    border-radius: 5px;
}

.nav-link:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.nav-link.dark {
    color: #ecf0f1;
}

.nav-link.dark:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.2);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-top: 20px;
    margin-bottom: 20px;
}

.container.dark {
    background: #34495e;
    color: #ecf0f1;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 40px;
}

.text-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-section, .output-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.input-section.dark, .output-section.dark {
    background: #4a6278;
}

.settings-section {
    position: sticky;
    top: 100px;
    height: fit-content;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 2.2em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    transition: color 0.3s ease;
}

h1.dark {
    color: #ecf0f1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

h3 {
    color: #444;
    margin-bottom: 20px;
    font-size: 1.6em;
    transition: color 0.3s ease;
}

h3.dark {
    color: #ecf0f1;
}

.options-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    justify-content: space-between;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.options-bar.dark {
    background: #4a6278;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.options-bar label {
    font-weight: bold;
    color: #555;
    font-size: 14px;
    transition: color 0.3s ease;
}

.options-bar label.dark {
    color: #ecf0f1;
}

.options-bar select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.options-bar select.dark {
    background-color: #5a738a;
    border-color: #6a829a;
    color: #ecf0f1;
}

textarea {
    width: 100%;
    height: 200px;
    margin: 15px 0;
    padding: 15px;
    border: 2px solid #ccc;
    border-radius: 10px;
    resize: vertical;
    font-size: 16px;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

textarea.dark {
    background-color: #4a6278;
    border-color: #5a738a;
    color: #ecf0f1;
}

textarea:focus {
    border-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
    outline: none;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #17a2b8;
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.upload-btn:hover {
    background: #138496;
}

button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #28a745;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #218838;
}

#clearBtn {
    background-color: #dc3545;
}

#clearBtn:hover {
    background-color: #c82333;
}

#exportBtn {
    background-color: #007bff;
    margin-top: 15px;
}

#exportBtn:hover {
    background-color: #0056b3;
}

.progress-bar {
    width: 100%;
    background: #e0e0e0;
    border-radius: 5px;
    height: 10px;
    margin: 10px 0;
    overflow: hidden;
}

.progress {
    width: 0;
    height: 100%;
    background: #28a745;
    transition: width 2s ease;
}

#output {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    min-height: 200px;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#output.dark {
    background: #4a6278;
    border-color: #5a738a;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.copy-btn:hover {
    background: #0056b3;
}

.icon {
    font-size: 16px;
}

.error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
}

.rtl { direction: rtl; text-align: right; }
.ltr { direction: ltr; text-align: left; }

ul {
    padding-left: 20px;
    margin: 15px 0;
}

li {
    margin: 8px 0;
    line-height: 1.6;
}

.subheading {
    font-weight: bold;
    font-size: 1.3em;
    margin: 20px 0;
    color: #333;
    transition: color 0.3s ease;
}

.subheading.dark {
    color: #ecf0f1;
}

/* تنسيق متجاوب */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .options-bar {
        flex-direction: column;
        gap: 15px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    button, .upload-btn {
        width: 100%;
        justify-content: center;
    }
}

/* تنسيق حجم الخط */
.font-small {
    font-size: 14px;
}

.font-medium {
    font-size: 16px;
}

.font-large {
    font-size: 18px;
}

/* Footer Content Styles */
.footer-content {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.footer-content.dark {
    border-top-color: #4a6278;
}

.features-section h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    transition: color 0.3s ease;
}

.features-section h3.dark {
    color: #ecf0f1;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-card.dark {
    background: #4a6278;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.feature-card h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
    transition: color 0.3s ease;
}

.feature-card h4.dark {
    color: #ecf0f1;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.feature-card p.dark {
    color: #bdc3c7;
}

/* Responsive Design for New Layout */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .settings-section {
        position: static;
        order: -1;
    }
    
    .options-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .option-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        gap: 15px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}