@import url('https://fonts.googleapis.com/css2?family=Amiri&display=swap');

/* Applying the styleOne pattern to the entire web page */
body {
    background-color: #c0edaa;
    background-image:
        linear-gradient(67.5deg, #c0edaa 10%, transparent 10%),
        linear-gradient(157.5deg, #c0edaa 10%, transparent 10%),
        linear-gradient(67.5deg, transparent 90%, #c0edaa 90%),
        linear-gradient(157.5deg, transparent 90%, #c0edaa 90%),
        linear-gradient(22.5deg, #c0edaa 10%, transparent 10%),
        linear-gradient(112.5deg, #c0edaa 10%, transparent 10%),
        linear-gradient(22.5deg, transparent 90%, #c0edaa 90%),
        linear-gradient(112.5deg, transparent 90%, #c0edaa 90%),
        linear-gradient(22.5deg, transparent 33%, #d5d8dc 33%, #d5d8dc 36%, transparent 36%, transparent 64%, #d5d8dc 64%, #d5d8dc 67%, transparent 67%),
        linear-gradient(-22.5deg, transparent 33%, #d5d8dc 33%, #d5d8dc 36%, transparent 36%, transparent 64%, #d5d8dc 64%, #d5d8dc 67%, transparent 67%),
        linear-gradient(112.5deg, transparent 33%, #d5d8dc 33%, #d5d8dc 36%, transparent 36%, transparent 64%, #d5d8dc 64%, #d5d8dc 67%, transparent 67%),
        linear-gradient(-112.5deg, transparent 33%, #d5d8dc 33%, #d5d8dc 36%, transparent 36%, transparent 64%, #d5d8dc 64%, #d5d8dc 67%, transparent 67%);
    background-size: 250px 250px;
    background-position: 
        -100px 150px, -150px 150px, -150px 100px, -100px 100px,
        -150px 100px, -100px 100px, -100px 150px, -150px 150px,
        0 0, 0 0, 0 0, 0 0;
    font-family: 'Amiri', serif;
    text-align: center;
    padding-top: 50px;
    direction: ltr;
    color: #d5d8dc;
}

body {
    font-family: Calibri, sans-serif;
    display: flex;
    justify-content: flex-start; /* Aligns instruction box and content horizontally */
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto; /* Enable vertical scrolling */
    gap: 20px; /* Space between the instruction box and main content */
}

.instruction-box {
    background-color: #fffcde;
    padding: 20px;
    border: groove;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 380px;
    text-align: justify;
    border-radius: 10px;
    color: black;
}

.instruction-box h2 {
    font-size: 26px;
    margin-bottom: 10px;
}

.instruction-box p,
.instruction-box ol,
.instruction-box ul {
    font-size: 16px;
    margin-bottom: 10px;
    color: black;
}

.instruction-box strong {
    font-weight: bold;
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%; /* Makes sure it takes the remaining space */
}

h1 {
    margin-bottom: 20px;
    font-size: 44px;
    color: #333;
    text-shadow: 3px 3px 0px #c78283;
}

.instruction {
    margin-bottom: 10px;
    font-size: 22px;
    color: #555;
}

textarea {
    width: 700px;
    height: 70px;
    padding: 10px;
    border: groove;
    border-radius: 7px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 20px;
    font-family: "Traditional Naskh Arabic", Arial, sans-serif;
    direction: rtl;
}

.button-container {
    margin-top: 20px;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

button {
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: outset;
    border-radius: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#output {
    display: flex;
    flex-direction: row; /* Boxes will appear from right to left */
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap; /* Allows the content to wrap if there are many boxes */
}

.box {
    width: 150px;
    padding: 8px;
    background-color: white;
    border: 2px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 20px;
    text-align: center;
    color: black;
    font-family: "Traditional Naskh Arabic", Arial, sans-serif;
    cursor: pointer;
}

/* Color Coding */
.green { background-color: #8BC34A; }  /* Sahih (Thiqah) */
.blue { background-color: #64B5F6; }   /* Hasan (Saduq) */
.yellow { background-color: #FFEB3B; } /* Dhaif Muhtamal */
.orange { background-color: #FF9800; } /* Dhaif */
.red { background-color: #E57373; }    /* Palsu */
.chocolate { background-color: #D2691E; } /* Syadid al-Dhaf */

#resultBox {
    margin-top: 20px;
    padding: 10px;
    border: 3px outset #ccc;
    border-radius: 7px;
    width: 100px; /* Adjusted width */
    text-align: center;
    color: black;
    font-size: 20px;
    background-color: white; /* Initial background color */
}

table {
    border-collapse: collapse;
    margin-top: 20px;
    width: 400px;
}

table, th, td {
    border: groove;
    padding: 10px;
    text-align: center;
    color: black;
}

th {
    background-color: #f4f4f4;
}

/* Modal Styling */
.modal {
    display: none; 
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    padding-top: 60px;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    border: groove;
    width: 80%;
    max-width: 700px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: black;
}

.close {
    color: #aaa; 
    float: right;
    font-size: 28px;
    cursor: pointer;
}

.close:hover {
    color: #000;
    text-decoration: none;
}
