<style>
    @font-face {
        font-family: 'IranNastaliq';
        src: url('https://schooleh.ir/font/IranNastaliq.ttf') format('truetype');
    }
    @font-face {
        font-family: 'Vazir';
        src: url('https://schooleh.ir/font/Vazir.ttf') format('truetype');
    }
  
 
    @font-face {
        font-family: 'DimaShekasteh';
        src: url('https://schooleh.ir/font/DimaShekasteh.ttf') format('truetype');
    }
    @font-face {
        font-family: 'Yagut';
        src: url('https://schooleh.ir/font/Yagut.ttf') format('truetype');
    }

    @font-face {
        font-family: 'Najm';
        src: url('https://schooleh.ir/font/Najm.ttf') format('truetype');
    }


    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }
    body {
        font-family: 'Vazir', sans-serif;
        min-height: 100vh;
        color: #333;
        position: relative;
        direction: rtl;
        background: linear-gradient(135deg, #e0e0e0, #ffffff);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        overflow-y: scroll;
    }
    #header {
        width: 100%;
        padding: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2em;
        font-weight: bold;
        position: sticky; 
        top: 0;
        z-index: 10;
        background-color: rgba(0, 121, 107, 0.9);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        color: white;
        border-radius: 0 0 15px 15px; 
        text-align: center; 
        transition: background-color 0.5s ease;
    }
    #logo {
        width: 20%;  
        max-width: 150px;  
        margin: 5vh 0;  
        border-radius: 10px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
        transition: transform 0.3s, box-shadow 0.3s;
        position: relative;
        z-index: 20; 
    }
    #logo:hover {
        transform: scale(1.1) rotateY(10deg);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7);
    }
    .subtitle-box {
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 15px;
        padding: 20px;
        margin: 10px 0; 
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        text-align: center;
        width: 90%;
        max-width: 500px;
        transition: transform 0.3s;
    }
    .subtitle {
        font-size: 2em;
        font-weight: bold;
        color: rgb(0, 121, 107);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }
    .subtitle-secondary {
        font-size: 1.5em;
        color: rgb(0, 121, 107);
    }
    #headerImage {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        opacity: 0.2; 
        z-index: -2;
        object-fit: cover; 
    }
    .color-layer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0.5;
        z-index: -1;
        background: linear-gradient(135deg, rgba(0, 150, 136, 0.5), rgba(128, 221, 234, 0.5));
        transition: background 1s ease; 
    }
    .menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin: 20px 0;
        width: 100%;
        padding: 0 10px;
    }
    .menu-item {
        margin: 10px;
        text-align: center;
        font-size: 1em;
        color: rgb(0, 150, 136);
        text-decoration: none;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px; 
        border-radius: 15px; 
        background-color: rgba(255, 255, 255, 0.9);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        width: calc(30% - 20px); 
        max-width: 220px; 
        transition: transform 0.3s, box-shadow 0.3s, filter 0.3s;
    }
    .menu-item:hover {
        transform: translateY(-10px) rotateY(5deg);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
        filter: brightness(1.05);
    }
    .menu-item img {
        width: 100%; 
        height: auto; 
        max-width: 150px; 
        border-radius: 15%;
        margin-bottom: 5px;
        transition: transform 0.3s;
    }
    .menu-item:hover img {
        transform: scale(1.1);
    }
    .tooltip {
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background-color: rgba(0, 0, 0, 0.8);
        color: #fff;
        padding: 8px;
        border-radius: 5px;
        font-size: 0.9em;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s;
        z-index: 20;
    }
    .menu-item:hover .tooltip {
        opacity: 1;
        visibility: visible;
    }
    .button-text-box {
        background-color: rgba(0, 150, 136, 0.8);
        color: white;
        padding: 5px;
        border-radius: 5px;
        margin-top: 5px; 
    }
    footer {
        width: 100%;
        background-color: rgba(0, 121, 107, 0.9);
        color: white;
        text-align: center;
        padding: 15px;
        position: relative;
        margin-top: auto;
        opacity: 0.9; 
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }
    footer a {
        color: white;
        text-decoration: underline;
    }
    .settings-icon {
        position: fixed;
        right: 20px;
        bottom: 20px;
        width: 50px;
        height: 50px;
        background-color: rgba(0, 150, 136, 0.8);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        transition: background-color 0.3s;
    }
    .settings-icon:hover {
        background-color: rgba(0, 150, 136, 1);
    }
    .popup {
        display: none;
        position: fixed;
        right: 20px;
        bottom: 80px;
        background-color: white;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        padding: 10px;
        z-index: 100;
        animation: fadeIn 0.3s ease-out;
    }
    @keyframes fadeIn {
        from {
            transform: translateY(10px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    @keyframes fadeOut {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(10px);
            opacity: 0;
        }
    }
    .popup h3 {
        margin-bottom: 10px;
        font-size: 1.2em;
    }
    .popup button {
        margin: 5px 0;
        padding: 8px;
        width: 100%;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s;
        font-size: 0.9em;
    }
    .popup button:hover {
        background-color: rgba(0, 150, 136, 0.2);
    }

 






 
        font-family: 'Vazir', sans-serif; /* Changed default font to Vazir */
        margin: 0;
        padding: 0;
        background-color: #f4f4f4;
        color: #333;
        display: flex;
        flex-direction: column;
        min-height: 100vh; /* Ensures the footer stays at the bottom */
    }
    #header {
        background-color: rgba(0, 121, 107, 0.9);
        color: white;
        text-align: center;
        padding: 10px 0;
        font-size: 1.2em;
        position: relative;
    }
    #logo {
        display: block;
        margin: 20px auto;
        max-width: 200px;
    }
    .subtitle-box {
        text-align: center;
        margin: 5px 0; /* Reduced margin between school name and other elements */
    }
    .subtitle {
        font-size: 1.5em;
        font-weight: bold;
    }
    .grade {
        font-size: 1.2em; /* Font size for grade */
        margin-top: 5px;
    }
    .color-layer {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: -1;
    }
    .menu {
        display: flex;
        flex-direction: column;  
        align-items: center;
        margin: 5%; /* Set margin to 5% for spacing */
        flex-grow: 1; /* Allows the menu to take up available space */
    }
    .menu-item {
        text-align: center;
        margin: 10px 0;
        text-decoration: none;
        color: #333;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .button-image {
        width: 120px;  /* Increased size for buttons */
        height: 120px; /* Increased size for buttons */
    }
    .button-text-box {
        font-size: 1.2em; /* Decreased font size for buttons */
        margin-top: 5px;
    }
    footer {
        text-align: center;
        padding: 10px 0;
        background-color: rgba(0, 121, 107, 0.9); /* Matched footer background with header */
        color: white; /* Changed footer text color to white */
        font-size: 0.8em; /* Smaller font size for footer */
    }
    .settings-icon {
        position: fixed;
        bottom: 20px;
        right: 20px;
        cursor: pointer;
        background-color: rgba(0, 121, 107, 0.9);
        border-radius: 50%;
        padding: 15px; 
        color: white;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
        font-size: 24px; 
        z-index: 1000; /* Ensure it stays above other elements */
    }
    .popup {
        width: 250px; 
        padding: 10px;
        border-radius: 8px;
        background-color: white;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
        display: none;
    }
    .popup button {
        width: 100%;
        margin: 5px 0;
        padding: 12px; 
        border-radius: 5px;
        border: none;
        cursor: pointer;
        transition: background-color 0.3s;
        font-size: 1.1em; 
    }
    .popup button:hover {
        background-color: rgba(0, 121, 107, 0.1);
    }
    .color-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .color-circle {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: inline-block;
        margin: 5px;
        cursor: pointer;
    }

    /* Responsive Styles */
    @media (min-width: 768px) {
        .menu {
            flex-direction: row; 
        }
        .menu-item {
            margin: 0 15px; 
        }
    }

    @media (max-width: 767px) {
        .menu {
            flex-direction: row; 
            flex-wrap: wrap; 
            justify-content: center; 
        }
        .menu-item {
            width: 45%; 
            margin: 5px; 
        }
    }

    /* Optimized button text size for all screen sizes */
    .menu-item .button-text-box {
        font-size: 1em; /* Optimized font size for better visibility */
    }

    @media (max-width: 480px) {
        .menu-item .button-text-box {
            font-size: 0.9em; /* Slightly smaller on very small screens */
        }
    }

</style>