/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f7f7f7;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.flex-grow {
    flex-grow: 1;
}

.square-container {
    width: 50%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}
.container, .form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.05);
    margin: 60px auto;
    width: 40%;
    height: auto;
    flex-direction: column;
}

h1, h2, h3, label, #storeName, #storeId, p, .register-link {
    color: #333;
    margin: 20px 0;
}

label {
    display: inline-block;
    min-width: 100px;
    text-align: left;
    margin-right: 10px;
    margin-bottom: 5px;
    font-size: 16px;
}

.input-row {
    display: flex;
    justify-content: start;
    align-items: center;
    margin-bottom: 15px;
}

.input-row label {
    margin-right: 10px;
    white-space: nowrap;
}

.input-field {
    flex-grow: 1;
    width: calc(100% - 40px);
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    color: #333;
    background-color: #f7f7f7;
}

.input-field:focus {
    border-color: #333;
    box-shadow: 0 0 8px rgba(0, 122, 255, 0.5);
    outline: none;
}

button {
    background-color: #333;
    color: white;
    border: none;
    padding: 15px 30px;
    margin: 30px 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #005ecb;
}

/* Header and Menu Styles */
.header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 20px;
}

.logo-container {
    grid-column: 2 / 3;
    justify-self: center;
}

.logo-container img {
    max-width: 100px;
    height: auto;
}

.menu-container {
    grid-column: 3 / 4;
    justify-self: end;
}

.menu-icon {
    display: block;
    cursor: pointer;
    padding-right: 20px;
    font-size: 24px;
}

.burger-menu input[type="checkbox"] {
    display: none;
}

.burger-menu .menu {
    display: none;
    position: absolute;
    right: 20px;
    top: 50px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    width: auto;
    text-align: left;
}

.burger-menu input[type="checkbox"]:checked + label + .menu {
    display: block;
}

.menu a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
}

.menu a:hover {
    background-color: #f4f4f4;
}

.button-container {
    text-align: center;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

#increaseHit, #decreaseHit {
    font-size: 50px;
    width: 100px;
    height: 100px;
    text-align: center;
    border-radius: 10%;
    border: 2px solid #333;
    background-color: #333;
    color: #ffffff;
    cursor: pointer;
    margin: 0 10px;
    transition: background-color 0.3s, color 0.3s, transform 0.3s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

#increaseHit:hover, #decreaseHit:hover {
    background-color: #ffffff;
    color: #333;
    border-color: #333;
}

#increaseHit:active, #decreaseHit:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

#hitsTableContainer {
    margin: 20px auto;
    padding: 80px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#hitsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#hitsTable thead {
    background-color: #333;
    color: #ffffff;
}

#hitsTable th, #hitsTable td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

#hitsTable th {
    height: 50px;
}

#hitsTable td {
    height: 40px;
}

#hitsTable tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

#hitsTable tbody tr:hover {
    background-color: #ddd;
}

.hidden {
    display: none;
}

.site-footer {
    background-color: #f8f9fa;
    padding: 20px 0;
    text-align: center;
    color: #6c757d;
    margin-top: 20px;
    width: 100%;
}

/* The Modal (background) */
.modal {
    display: none;
    position: fixed;
    z-index: 2;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
}

/* Modal Content */
.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 40%;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    animation-name: animatetop;
    animation-duration: 0.4s;
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close-button {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

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

.users-container {
    width: 100%;
    border-collapse: collapse;
}

.users-container th, .users-container td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.users-container tr:nth-child(even) {
    background-color: #f2f2f2;
}

.users-container th {
    background-color: #333;
    color: white;
}

.manage-users-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.manage-users-square {
    width: 100%;
    margin: 0 auto;
    overflow-x: auto;
}

.manage-users-table {
    margin: 0 auto;
    width: auto;
    max-width: 100%;
}

.manage-user-input {
    width: 100%;
    max-width: 400px;
    margin: 10px 0;
}

.table thead {
    background-color: #333;
    color: white;
}

.table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

.table tbody tr:hover {
    background-color: #ddd;
}

.btn.custom-button {
    background-color: #333;
    border-color: #000;
    color: white;
    transition: background-color 0.3s ease;
    margin-bottom: 0px;
}

.btn.custom-button:hover {
    background-color: #333;
    border-color: #222;
}

.ml-2 {
    margin-left: 0.5rem;
}

.statistics-slicer {
    display: flex;
    flex-direction: row;
    align-items: flex-end; /* Align items to the bottom */
    justify-content: space-between;
    gap: 10px;
}

.statistics-slicer .form-group {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Align inputs to the bottom */
}

@media (max-width: 768px) {
    .statistics-slicer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .statistics-slicer .form-group,
    .statistics-slicer .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

.statistics-slicer .form-group button {
    margin-bottom: 0 !important;
}

/* Specific Styles for Statistics Page */
.statistics-container {
    width: 90%;
    margin: 0 auto;
}

.statistics-container canvas {
    width: 100% !important;
    height: 400px !important;
}

.statistics-container #statisticsTable {
    width: 100%; /* Make the table width 100% */
    margin: 0 auto;
    min-width: 50vw;
}

#statisticsTable thead.hidden {
    display: none;
}

.statistics-container .row.mt-4.text-right {
    margin-top: 20px;
}

.statistics-container .row.mt-4.text-right button {
    margin-bottom: 0px;
}





/* Specific Styles for Statistics Page */
.statistics-container .statistics-table {
    width: 100% !important;
    margin: 0 auto !important;
    min-width: 50vw !important;
    border-collapse: collapse !important; /* Ensure borders collapse */
}

.statistics-container .statistics-table th,
.statistics-container .statistics-table td {
    padding: 8px !important;           /* Consistent padding */
    border: 1px solid #ddd !important; /* Consistent borders */
    text-align: left !important;       /* Consistent text alignment */
    vertical-align: middle !important; /* Consistent vertical alignment */
    height: auto !important;           /* Use padding to control height */
}

.statistics-container .statistics-table thead {
    background-color: #333 !important; /* Header background color */
    color: #ffffff !important;         /* Header text color */
}

.statistics-container .statistics-table th {
    font-weight: bold !important; /* Ensure headers are bold */
}

/* Specific override for the statistics table headers */
.statistics-container .statistics-table th {
    display: table-cell !important; /* Override flex display */
}

/* Override for .d-flex applied to table headers */
.statistics-container .statistics-table th.d-flex {
    display: table-cell !important;    /* Ensure headers are displayed as table cells */
    justify-content: initial !important; /* Remove flexbox alignment */
    align-items: initial !important;   /* Remove flexbox alignment */
}


.statistics-container .statistics-table tbody tr:nth-child(even) {
    background-color: #f2f2f2 !important; /* Row background color for even rows */
}

.statistics-container .statistics-table tbody tr:hover {
    background-color: #ddd !important; /* Row background color on hover */
}






@media (max-width: 768px) {
    .container, .form-container {
        width: 90%;
        padding: 20px;
    }

    button {
        padding: 15px 20px;
        font-size: 18px;
    }

    .header {
        grid-template-columns: 1fr;
        place-items: center;
    }

    .logo-container, .menu-container {
        justify-self: center;
        grid-column: 1 / 2;
    }

    .menu-container {
        order: 1;
    }

    .burger-menu .menu {
        right: 0;
        top: 60px;
    }

    .footer-container {
        width: 100%;
    }
}
