:root {
            --primary: #1a4731;
            --secondary: #2d6a4f;
            --accent: #40916c;
            --gold: #d4a373;
            --cream: #faf6f1;
            --dark: #1b4332;
            --background: #f8f9fa;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            --text-tertiary: var(--gold);
            --error: #e74c3c;
            --error-light: #fdedeb;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: var(--background);
            color: var(--dark);
            height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        header {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            padding: 1rem;
            text-align: center;
            box-shadow: var(--shadow);
        }

        header h1 {
            font-size: 1.8rem;
            margin-bottom: 0.2rem;
        }

        header p {
            font-size: 0.9rem;
            max-width: 800px;
            margin: 0 auto;
            opacity: 0.9;
        }

        .gold-text {
            color: var(--gold);
        }

        main {
            flex: 1;
            padding: 0.8rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            max-height: calc(100vh - 8.6rem);
        }

        .container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            width: 100%;
            max-width: 500px;
            height: 100%;
        }

        .options {
            display: flex;
            gap: 1rem;
            justify-content: center;
            width: 100%;
        }

        .option-card {
            background-color: white;
            border-radius: 12px;
            box-shadow: var(--card-shadow);
            flex: 1;
            overflow: hidden;
            transition: var(--transition);
            cursor: pointer;
            height: 100%;
            max-height: 280px;
            display: flex;
            flex-direction: column;
        }

        .option-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        }

        .option-card .card-header {
            background: linear-gradient(135deg, var(--secondary), var(--accent));
            color: white;
            padding: 1rem;
            text-align: center;
        }

        .option-card .card-header i {
            font-size: 2rem;
            margin-bottom: 0.5rem;
            color: var(--cream);
        }

        .option-card .card-header h3 {
            font-size: 1.2rem;
            margin-bottom: 0.3rem;
        }

        .option-card .card-body {
            padding: 1rem;
            text-align: center;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            flex: 1;
        }

        .option-card .card-body p {
            margin-bottom: 0.8rem;
            color: #555;
            line-height: 1.4;
            font-size: 0.9rem;
        }

        .btn {
            background-color: var(--accent);
            color: white;
            border: none;
            padding: 0.6rem 1.2rem;
            border-radius: 6px;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
            display: inline-block;
        }

        .btn:hover {
            background-color: var(--primary);
            transform: translateY(-3px);
        }

        .btn-outline {
            background-color: transparent;
            border: 2px solid var(--accent);
            color: var(--accent);
        }

        .btn-outline:hover {
            background-color: var(--accent);
            color: white;
        }

        .tool-container {
            background-color: white;
            border-radius: 12px;
            box-shadow: var(--card-shadow);
            padding: 1.2rem;
            width: 100%;
            display: none;
            height: 100%;
            max-height: 380px; 
            overflow-y: auto;
        }

        .tool-header {
            text-align: center;
            margin-bottom: 1rem;
        }

        .tool-header h2 {
            color: var(--primary);
            margin-bottom: 0.3rem;
            font-size: 1.3rem;
        }

        .tool-header p {
            font-size: 0.85rem;
            color: #666;
        }

        .form-group {
            margin-bottom: 1rem;
        }

        label {
            display: block;
            margin-bottom: 0.3rem;
            color: var(--dark);
            font-weight: 500;
            font-size: 0.9rem;
        }

        input[type="file"],
        input[type="number"] {
            width: 100%;
            padding: 0.6rem;
            border-radius: 6px;
            border: 1px solid #ddd;
            background-color: var(--cream);
            transition: var(--transition);
            font-size: 0.9rem;
        }
        input[type="number"] {
            text-align: center;
        }


        input[type="file"]:focus,
        input[type="number"]:focus {
            border-color: var(--accent);
            outline: none;
            box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.2);
        }

        .range-container {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }
        .range-container input[type="number"] {
            flex: 1; 
        }

        .range-container span {
            font-weight: 500;
            font-size: 0.9rem;
        }

        .file-list {
            list-style: none;
            margin: 0.5rem 0;
            padding: 0;
            max-height: 120px;
            overflow-y: auto;
        }

        .file-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.5rem;
            background-color: var(--cream);
            border-radius: 6px;
            margin-bottom: 0.3rem;
            font-size: 0.85rem;
        }

        .file-item .file-name {
            font-weight: 500;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            max-width: calc(100% - 30px); 
        }

        .file-item .btn-remove {
            background-color: #e74c3c;
            color: white;
            border: none;
            border-radius: 4px;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition);
            font-size: 0.8rem;
            flex-shrink: 0; 
        }

        .file-item .btn-remove:hover {
            background-color: #c0392b;
        }

        .actions {
            display: flex;
            justify-content: center;
            gap: 0.8rem;
            margin-top: 1rem;
        }

        .float-buttons {
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            z-index: 1000;
        }

        .float-button {
            background-color: var(--primary);
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: var(--shadow);
            transition: var(--transition);
            font-size: 0.9rem;
            position: relative;
        }

        .float-button:hover {
            background-color: var(--secondary);
            transform: scale(1.1);
        }

        .language-dropdown {
            position: absolute;
            bottom: 45px;
            right: 0;
            background-color: white;
            border-radius: 8px;
            box-shadow: var(--card-shadow);
            padding: 0.8rem;
            display: none;
            min-width: 120px;
            z-index: 1001;
            color: var(--dark);
        }

        .language-dropdown.show {
            display: block;
        }

        .language-option {
            padding: 0.4rem 0.8rem;
            cursor: pointer;
            transition: var(--transition);
            border-radius: 4px;
            font-size: 0.9rem;
        }

        .language-option:hover {
            background-color: var(--cream);
        }

        .language-option.active {
            background-color: var(--accent);
            color: white;
        }

        .loading {
            display: none;
            text-align: center;
            margin: 1rem 0;
        }

        .loading-spinner {
            width: 30px;
            height: 30px;
            border: 3px solid rgba(64, 145, 108, 0.2);
            border-radius: 50%;
            border-top-color: var(--accent);
            animation: spin 1s ease-in-out infinite;
            margin: 0 auto 0.5rem;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .success-message {
            display: none;
            text-align: center;
            background-color: #d4edda;
            color: #155724;
            padding: 0.8rem;
            border-radius: 6px;
            margin: 1rem 0;
        }

        .success-message i {
            margin-right: 0.3rem;
        }
        .success-message .download-link {
            margin-top: 0.8rem;
            display: inline-block; 
        }

        .error-message {
            display: none;
            text-align: center;
            background-color: var(--error-light);
            color: var(--error);
            padding: 0.8rem;
            border-radius: 6px;
            margin: 0.5rem 0;
            font-size: 0.9rem;
        }

        .error-message i {
            margin-right: 0.3rem;
        }

        footer {
            background-color: var(--dark);
            color: white;
            text-align: center;
            padding: 0.8rem;
            font-size: 0.8rem;
        }

        footer p {
            opacity: 0.8;
        }

        .rtl {
            direction: rtl;
        }

        .rtl header, .rtl .tool-header, .rtl .option-card .card-body, .rtl footer, .rtl .loading, .rtl .success-message {
            text-align: right;
        }
        .rtl .range-container input[type="number"] {
            text-align: center; 
        }

        .rtl .float-buttons {
            right: auto;
            left: 1rem;
        }

        .rtl .language-dropdown {
            right: auto;
            left: 0;
        }
        .rtl .file-item .file-name {
            margin-right: auto;
            margin-left: 0.5rem; 
        }
        .rtl .success-message i {
            margin-left: 0.3rem;
            margin-right: 0;
        }


        @media (max-height: 600px) {
            header {
                padding: 0.5rem;
            }

            header h1 {
                font-size: 1.5rem;
            }

            .option-card .card-header i {
                font-size: 1.5rem;
            }

            .option-card .card-header {
                padding: 0.7rem;
            }

            .option-card .card-body {
                padding: 0.7rem;
            }

            .option-card .card-body p {
                font-size: 0.8rem;
                margin-bottom: 0.5rem;
            }

            .btn {
                padding: 0.4rem 0.8rem;
                font-size: 0.8rem;
            }

            footer {
                padding: 0.5rem;
            }
        }

#faq-link {
    color: var(--gold);
    text-decoration: none;
    margin-left: 10px;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}
#faq-link:hover {
    border-bottom-color: var(--gold);
}

#faq-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(27, 67, 50, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
#faq-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

#faq-modal {
    background-color: var(--cream);
    color: var(--dark);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
#faq-modal-overlay.active #faq-modal {
    transform: scale(1);
}

#faq-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--secondary);
    cursor: pointer;
    transition: var(--transition);
}
#faq-close-button:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.faq-main-title { font-size: 1.5rem; font-weight: 600; color: var(--primary); text-align: center; margin-bottom: 1.5rem; }
.faq-container { display: flex; flex-direction: column; gap: 0.8rem; }
.faq-item { border: 1px solid #eee; border-radius: 8px; background-color: var(--background); transition: var(--transition); text-align: left; }
.faq-item:hover { border-color: var(--accent); }
.faq-question { padding: 1rem; font-size: 1.1rem; font-weight: 500; color: var(--dark); cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-question::-webkit-details-marker { display: none; }
.faq-arrow { font-size: 1.5rem; font-weight: 400; color: var(--accent); transition: transform 0.2s ease-in-out; }
.faq-item[open] > summary { font-weight: 600; color: var(--primary); }
.faq-item[open] .faq-arrow { transform: rotate(45deg); }
.faq-answer { padding: 0 1rem 1rem 1rem; font-size: 0.95rem; line-height: 1.6; color: #555; }
.faq-answer p, .faq-answer ol { margin-bottom: 0.8rem; }
.faq-answer p:last-child, .faq-answer ol:last-child { margin-bottom: 0; }
.faq-answer ol { padding-left: 20px; }
body.rtl .faq-item, body.rtl .faq-answer { text-align: right; }
body.rtl .faq-answer ol { padding-left: 0; padding-right: 20px; }