@font-face {
    font-family: 'Saudi-Regular';
    src: url('fonts/Saudi-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Saudi-Medium';
    src: url('fonts/Saudi-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Saudi-SemiBold';
    src: url('fonts/Saudi-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Saudi-Bold';
    src: url('fonts/Saudi-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

:root {
    --primary-color: #006c35;  /* اللون الأخضر السعودي */
    --secondary-color: #ffffff;
    --accent-color: #f4f4f4;
    --text-color: #333333;
    --border-color: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Saudi-Regular', Arial, sans-serif;
    background-color: #f5f5f5;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 75L25 50 50 25l25 25-25 25z' fill='%23006c35' fill-opacity='0.03'/%3E%3C/svg%3E");
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 90%;
    max-width: 900px;
    border-top: 5px solid var(--primary-color);
}

header {
    margin-bottom: 30px;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo img {
    width: 50px;
    height: 50px;
}

h1 {
    color: var(--primary-color);
    font-family: 'Saudi-Bold', Arial, sans-serif;
    font-size: 28px;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 20px;
    font-family: 'Saudi-SemiBold', Arial, sans-serif;
}

main {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--primary-color);
}

.input-section {
    margin-bottom: 25px;
}

textarea {
    width: 100%;
    height: 100px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    direction: rtl;
    font-family: 'Saudi-Regular', Arial, sans-serif;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.output-section {
    background-color: var(--accent-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

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

.output-container {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    min-height: 150px;
}

.saudi-font {
    text-align: right;
    line-height: 1.6;
    font-size: 24px;
    min-height: 100px;
    color: var(--primary-color); /* لون النص الافتراضي هو الأخضر السعودي */
}

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

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

input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    font-family: 'Saudi-Regular', Arial, sans-serif;
}

.download-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Saudi-Medium', Arial, sans-serif;
    transition: background-color 0.3s;
}

.download-btn:hover {
    background-color: #00592c;
}

footer {
    text-align: center;
    color: #777;
    font-size: 14px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    font-size: large;
}

@media (max-width: 768px) {
    .controls {
        grid-template-columns: 1fr;
    }
    
    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .download-btn {
        width: 100%;
    }
}