html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background: #f4f4f4; /* Light grey background */
    font-size: 1rem;
}

.language-switcher a {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
    margin: 0 6px;
}

.language-switcher a:hover {
    text-decoration: underline;
}

/* RTL support */
body.rtl .topbar {
    text-align: left;
}

h1 {
    color: #333;
    text-align: center;
    font-size: 50px;
}
.form-group {
    margin-bottom: 10px; /* Spacing between each form group */
    display: flex;
    align-items: center; /* Aligns items vertically center */
}
.form-group label {
    margin-bottom: 5px;
    font-size: 25px; /* Enhances readability */
    color: #333;
}
.ltr .form-group label {
    margin-right: 5px;
}
.form-group textarea {
    height: 80px; /* Smaller height for the textarea */
    width: 20%; /* Optional: makes the textarea stretch to fill width */
}
.error-message {
    color: red; /* Color for error messages */
    margin-bottom: 20px; /* Space below the error message */
}
input[type="text"], input[type="date"], input[type="number"], textarea {
    width: auto; /* Full width inputs */
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Box-sizing set to border-box for padding inclusion */
    font-size: 20px;
}
button {
    width: auto;
    padding: 10px;
    background-color: #0080ff; /* A pleasing shade of blue */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); 
    font-size: 20px;
}
button:hover {
    background-color: #006bd7; /* Darker blue on hover */
}
.error-message {
    color: red;
    text-align: center;
    width: 100%;
}
.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .form-group {
    align-items: flex-end;
}

.rtl button {
    align-self: center; /* Center the button in RTL */
}
html[lang="he"] .form-group label {
    margin-left: 10px; /* Adjust the space as needed */
}

.tooltip {
    margin-left: 5px;
    margin-right: 5px;
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* Position above the tooltip element */
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%; /* At the bottom of the tooltip */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext,
.tooltip.active .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.topbar,
.navbar {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 10px 15px;
}

.navbar a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.navbar a:hover {
    background-color: #e7f1ff;
    color: #0056b3;
}

@media (max-width: 768px) {
    .topbar {
        text-align: center;
        padding: 8px 10px;
        font-size: 14px;
    }

    .navbar {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 10px;
        font-size: 14px;
    }

    .navbar a {
        font-size: 14px;
    }

    .container {
        width: 100%; /* Use full width of the screen */
        padding: 10px; /* Add some padding around */
    }

    .form-group {
        flex-direction: column; /* Stack inputs vertically on small screens */
        align-items: stretch;
    }

    .form-group label,
    input[type="text"], input[type="date"], input[type="number"], textarea, select {
        width: 100%; /* Full width for form elements */
        margin-bottom: 10px; /* Spacing between each form element */
    }

    input[type="submit"], button {
        width: 100%; /* Full width for buttons */
        padding: 10px 0; /* Larger area for easier interaction */
    }

    .form-group label {
        margin-bottom: 5px; /* Space between label and input */
    }

    h1, p {
        text-align: center; /* Centering text for better readability */
    }

    .tooltip {
        margin-top: 10px;
        margin-left: 0;
    }
    
    .tooltiptext {
        width: 150px; /* Adjust width for smaller screens */
        left: 25%;
        margin-left: -75px;
    }
}

@media (max-width: 480px) {
    .topbar {
        text-align: center;
        background-color: #fff;
        border-bottom: 1px solid #eee;
        padding: 10px 15px;
        margin: 0;
    }

    .navbar {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px 15px;
        background-color: #fff;
        border-bottom: 1px solid #eee;
        margin: 0;
    }

    .navbar a {
        font-size: 14px;
        margin: 6px 0;
    }

    .tooltiptext {
        width: 100px; /* Adjust width for smaller screens */
        left: 20%;
        margin-left: -50px;
    }

    .language-switcher {
        position: static;
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group select {
        padding: 8px;
    }
}