@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@400;700&display=swap");

body {
    font-family: "Raleway", sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f0f4f7, #e2e8f0);
    color: #333333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.container {
    text-align: center;
    background-color: #ffffff;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 90%;
    margin: 0 auto;
    animation: fadeIn 1s ease-in-out;
    box-sizing: border-box;
}

h1 {
    margin-bottom: 20px;
    font-size: 32px;
    font-weight: 700;
    color: #007bff;
}

p.description {
    margin-bottom: 40px;
    font-size: 18px;
    color: #555555;
    text-align: justify;
}

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

.box {
    color: #ffffff;
    background-color: #4CAF50;
    /* Add a default background color here */
    text-decoration: none;
    padding: 20px;
    border-radius: 15px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    height: 100px;
    overflow: hidden;
}

/* Assign different background colors to each box with better contrast */
.box:nth-child(1) {
    background-color: #e57373;
    /* Darker Red */
}

.box:nth-child(2) {
    background-color: #64b5f6;
    /* Darker Blue */
}

.box:nth-child(3) {
    background-color: #81c784;
    /* Darker Green */
}

.box:nth-child(4) {
    background-color: #ffb74d;
    /* Darker Orange */
}

.box:nth-child(5) {
    background-color: #ba68c8;
    /* Darker Purple */
}

.box:nth-child(6) {
    background-color: #ff7f50;
    /* Coral */
}

.box:nth-child(7) {
    background-color: #4dd0e1;
    /* Darker Cyan */
}

.box:nth-child(8) {
    background-color: #f06292;
    /* Darker Pink */
}

.box:nth-child(9) {
    background-color: #17a2b8;
    /* Darker Teal */
}

.box:nth-child(10) {
    background-color: #ffd700;
    /* Gold */
}

.box:nth-child(11) {
    background-color: #8bc34a;
    /* Light Green */
}

.box:nth-child(12) {
    background-color: #ff6347;
    /* Tomato */
}

.box:nth-child(13) {
    background-color: #6a5acd;
    /* Slate Blue */
}

.box:nth-child(14) {
    background-color: #ff4500;
    /* Orange Red */
}

.box:nth-child(15) {
    background-color: #20b2aa;
    /* Light Sea Green */
}

.box:nth-child(16) {
    background-color: #da70d6;
    /* Orchid */
}

.box:nth-child(17) {
    background-color: #32cd32;
    /* Lime Green */
}

.box:nth-child(18) {
    background-color: #ff69b4;
    /* Hot Pink */
}

.box:nth-child(19) {
    background-color: #4169e1;
    /* Royal Blue */
}

.box:nth-child(20) {
    background-color: #dc143c;
    /* Crimson */
}

.box:nth-child(21) {
    background-color: #9932cc;
    /* Dark Orchid */
}

.box:nth-child(22) {
    background-color: #228b22;
    /* Forest Green */
}

.box:nth-child(23) {
    background-color: #ff8c00;
    /* Dark Orange */
}

/* Hover effect for boxes */
.box:hover {
    background-color: #0056b3;
    /* Dark Blue on hover */
    transform: translateY(-2px);
}

.comments-section {
    text-align: left;
    margin-top: 40px;
}

.comments-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333333;
}

.comment {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.comment strong {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
    font-weight: 600;
}

.comment p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    text-align: justify;
}

.comment small {
    color: #999;
    font-size: 12px;
    align-self: flex-end;
    margin-top: 10px;
}

.delete-comment {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 16px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 10px;
}

.delete-comment:hover {
    color: #c82333;
}

.comment-form {
    margin-top: 20px;
}

.comment-form textarea {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 16px;
    resize: none;
    box-sizing: border-box;
}

.comment-form button {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #ffc107;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.comment-form button:hover {
    background-color: #e0a800;
}

.auth-forms {
    margin-top: 20px;
    text-align: left;
}

.auth-forms h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.auth-forms form {
    margin-bottom: 20px;
}

.auth-forms input {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 16px;
}

.auth-forms button {
    padding: 10px 20px;
    background-color: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.auth-forms button:hover {
    background-color: #0056b3;
}

/* Login Button */
#loginBtn {
    background-color: #28a745;
}

#loginBtn:hover {
    background-color: #218838;
}

/* Register Button */
#registerBtn {
    background-color: #17a2b8;
}

#registerBtn:hover {
    background-color: #138496;
}

/* Modal container */
.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.4);
    padding-top: 60px;
}

/* Modal content */
.overlay-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 800px;
    max-width: 90%;
    max-height: 90vh;
    /* Limit height to viewport */
    overflow-y: auto;
    /* Enable scrolling if content exceeds the height */
    text-align: center;
    position: relative;
}

/* The Close Button */
.close {
    color: #dc3545;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #c82333;
    text-decoration: none;
    cursor: pointer;
}

button {
    padding: 10px 20px;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px;
    transition: background-color 0.3s ease;
}

/* Overlay Styles */
.overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.overlay-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 800px;
    max-width: 90%;
    text-align: center;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 28px;
    color: #333;
    cursor: pointer;
}

@media (max-width: 600px) {

    html,
    body {
        overflow-x: hidden;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        padding: 0 10px;
    }

    .container {
        padding: 20px;
        width: 100%;
        box-shadow: none;
    }

    .box {
        padding: 15px;
        height: auto;
    }

    p.description {
        font-size: 16px;
    }

    .comments-section h2 {
        font-size: 22px;
    }

    .auth-forms {
        text-align: center;
    }

    .auth-forms input,
    .auth-forms button {
        width: 100%;
    }

    .modal-content {
        width: 90%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}