/* Font face for custom font */
@font-face {
    font-family: 'Blippo'; /* The name you want to give to your font */
    src: url('/static/fonts/blippo.ttf') format('truetype'); /* Path to your font file */
    font-weight: normal;
    font-style: normal;
}

/* General styles */
* {
    font-family: 'Blippo', Arial, sans-serif;
}

/* Modal background styles */
.modal-background {
    display: none;
    position: fixed;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background-color: transparent;
    background-image: url("/static/images/pooltable.png");
    background-size: 100% 100%; /* Stretch the image to fit the element */
    background-position: center;
    background-repeat: no-repeat; /* Prevent repetition of the image */
    box-shadow: 0px 0px 15px 5px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 2s ease;
    z-index: 0;
}

/* Modal content styles */
.modal-content {
    display: none;
    position: fixed;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
    color: white;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 2s ease;
    z-index: 10;
}

/* Grid layout for modal content */
.modal-grid {
    display: grid;
    grid-template-columns: 50% 50%; /* Set the columns to 50% each */
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Grid items */
.modal-grid-item {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0.5em;
    color: black;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
    max-height: 90%;
    overflow: hidden;
}

/* Grid item images */
.modal-grid-item img {
    max-width: 80%;
    max-height: 80%;
    width: auto;
    height: auto;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

/* Apply the same styles to both login and register forms */
#login-form, #register-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Aligns the content to the top */
    padding: 2.5em;
    border-radius: 10px;
    width: 90%; /* Ensure both forms have the same width */
    height: 80%; /* Ensure both forms have the same height */
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
    margin: 0 auto; /* Centers the form horizontally */
    position: relative;
    top: 0;
    transform: translateY(0);
}

/* Form Heading */
#login-form h2, #register-form h2 {
    font-size: 2em; /* Slightly larger font for better emphasis */
    font-style: bold;
    color: rgb(154,202,60);
    font-family: '', sans-serif;
    font-weight: bold;
    text-shadow: 
        -0.5px -0.5px 0 black,   /* Top-left */
        0.5px -0.5px 0 black,    /* Top-right */
        -0.5px 0.5px 0 black,    /* Bottom-left */
        0.5px 0.5px 0 black;     /* Bottom-right */
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center the contents */
    margin-bottom: 0.5em;
    width: 100%; /* Full width to align properly within the parent */
    box-sizing: border-box;
    text-align: center;
    font-family: 'Arial', sans-serif;
}

/* Labels */
.form-group label {
    margin: 0;
    display: block;
    font-weight: normal;
    color: rgb(154,202,60);
    font-size: 1.5em;
    font-style: bold;
    text-align: center; /* Center the label text */
    text-shadow: 
        -0.5px -0.5px 0 black,   /* Top-left */
        0.5px -0.5px 0 black,    /* Top-right */
        -0.5px 0.5px 0 black,    /* Bottom-left */
        0.5px 0.5px 0 black;     /* Bottom-right */
}

/* Input Fields */
.form-group input {
    width: 100%; /* Full width of its parent */
    max-width: 300px; /* Set a max-width to avoid being too wide */
    padding: 0.5em 1em; /* Even padding on top/bottom and left/right */
    border: 1px solid #47220b;
    border-radius: 20px; /* Rounded corners */
    font-size: 1em;
    transition: border-color 0.3s ease;
    box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.1); /* Subtle inner shadow */
    background-color: azure;
    box-sizing: border-box; /* Ensure padding and borders are included in width */
    vertical-align: middle; /* Ensures the text aligns to the middle */
    text-align: center;
}

.form-group input:focus {
    border-color: rgb(154,202,60); /* More noticeable focus color */
    outline: none;
}

/* Button styling */
/* Button styling */
.btn {
    position: relative;
    padding: 0.8em 1em; /* Even padding on top/bottom and left/right */
    background-color: #ffc400;
    color: #000000;
    border: none;
    border-radius: 25px; /* Rounded button */
    cursor: pointer;
    font-size: 1.5em;
    font-weight: bold;
    width: 100%;
    max-width: 300px; /* Match input field width */
    height: 50px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2); /* Soft shadow for depth */
    margin-top: 0.5em; /* Add some margin to separate from input fields */
    text-align: center; /* Center the text horizontally */
    display: flex; /* Use flexbox to center text vertically */
    align-items: center; /* Center items vertically within the button */
    justify-content: center; /* Center items horizontally within the button */
    text-shadow: 
        -0.5px -0.5px 0 white,   /* Top-left */
        0.5px -0.5px 0 white,    /* Top-right */
        -0.5px 0.5px 0 white,    /* Bottom-left */
        0.5px 0.5px 0 white;     /* Bottom-right */
    white-space: nowrap; /* Prevent text from wrapping */
    overflow: hidden; /* Hide any overflowed text */
    text-overflow: ellipsis; /* Add ellipsis if text overflows */
}

/* Button hover and active states */
.btn:hover {
    background-color: #ff9900;
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.3); /* Stronger shadow on hover */
}

.btn:active {
    transform: translateY(0); /* Revert on click */
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2); /* Revert shadow on click */
}


/* Login and register button text and hover effects */
.login-btn:hover::after {
    content: "Balletje 'Vo!";
    opacity: 1;
}

.register-btn:hover::after {
    content: "Feut!";
    opacity: 1;
}

/* Login and register button text and hover effects */
.login-btn::after {
    content: "Inloggen";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000000;
    font-size: 1em;
    font-weight: bold;
    transition: opacity 1s ease;
}

.register-btn::after {
    content: "Registeren";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000000;
    font-size: 1em;
    font-weight: bold;
    transition: opacity 1s ease;
}

/* Media Query for Tablets and Smaller Screens */
@media (max-width: 768px) {
    .modal-grid {
        grid-template-columns: 1fr; /* Single column layout for smaller screens */
    }

    /* Swap background image for rotated pool table */
    .modal-background {
        background-image: url("/static/images/pooltablerotated.png");
    }

    #login-form, #register-form {
        height: 80%;
        width: 95%;
    }

    #login-form h2, #register-form h2 {
        font-size: 1em;
    }

    .form-group {
        width: 90%;
    }

    .form-group input {
        padding: 0.4em 1em; /* Even padding on top/bottom and left/right */
        font-size: 0.9em;
    }
    
    .btn {
        height: 30px;
        padding: 0.8em 1em; /* Adjusted padding for smaller screens */
        font-size: 1em; /* Adjust font size */
        width: calc(100% - 2em); /* Adjust width to compensate for padding */
        max-width: 300px; /* Ensure max-width stays consistent */
        margin-top: 0.4em; /* Slightly less margin on smaller screens */
        box-sizing: border-box; /* Ensure padding is included in width */
    }

    #login-form h2, #register-form h2 {
        font-size: 1.2em;
    }
    
    .form-group label {
        font-size: 1.3em;
    }
}

/* Media Query for Mobile Devices */
@media (max-width: 480px) {
    .modal-grid {
        grid-template-columns: 1fr; /* Single column layout for smaller screens */
    }

    /* Swap background image for rotated pool table */
    .modal-background {
        background-image: url("/static/images/pooltablerotated.png");
    }


    #login-form, #register-form {
        height: 80%;
        width: 95%;
    }

    #login-form h2, #register-form h2 {
        font-size: 1.3em;
    }

    .form-group {
        width: 80%;
    }

    .btn {
        height: 26px;
        padding: 0.6em 1em; /* Ensure consistent padding */
        font-size: 1em; /* Smaller font size for mobile */
        width: calc(100% - 2em); /* Adjust width to compensate for padding */
        max-width: 300px; /* Keep the same max-width */
        margin-top: 0.4em; /* Consistent margin */
        box-sizing: border-box; /* Ensure padding is included in width */
    }
    
    #login-form h2, #register-form h2 {
        font-size: 1.2em;
    }
    
    .form-group label {
        font-size: 1.3em;
    }
}

/* Animation classes */
.modal-grid-item {
    transition: opacity 0.5s ease;
}

.fade-out {
    opacity: 0;
}

.fade-in {
    opacity: 1;
}

.fade-in-active {
    opacity: 1;
}

.rotate {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Base image wrapper styling */
.image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: auto;
    max-width: 100%; /* Restrict maximum size */
    padding: 1em;
}

/* Image styling within the wrapper */
.image-wrapper img {
    width: 100%;
    max-width: 80%; /* Ensure the image doesn’t get too large */
    height: auto; /* Maintain aspect ratio */
}

/* Media Query for Tablets and Smaller Screens */
@media (max-width: 768px) {
    .image-wrapper img {
        max-width: 45%; /* Adjust size for tablets */
    }
}

/* Media Query for Mobile Devices */
@media (max-width: 480px) {
    .image-wrapper img {
        max-width: 40%; /* Further adjust size for mobile */
    }

    /* Further adjustments to ensure form fits well */
    #login-form, #register-form {
        padding: 1em; /* Reduce padding for more space */
    }

    .btn {
        font-size: 1em; /* Adjust button font size for smaller screens */
    }
}
