/* styles.css */

:root {
    --color-black: #333;
    --color-blue: #0693e3;
    --color-blue-hovered: #2daeff;
    --color-red: #d9534f;
    --color-red-hovered: #d32f2f;
    --red-error-bg: #f8d7da;
}

@font-face {
    font-family: "UncutSans";
    src: url("./fonts/UncutSans.ttf") format("truetype");
}

* {
    margin: 0;
    padding: 0;
    font-family: 'UncutSans', sans-serif;
    box-sizing: border-box;
    outline: none;
}

body {
    box-sizing: border-box;
    background-color: #f7fafc;
    color: var(--color-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
}

button {
    user-select: auto;
}

/* Header */
header {
    width: 100%;
    background-color: #fff;
    text-align: center;
    background-image: url('imgs/bg_header-blue.png');
    background-size: cover;
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#logo {
    max-width: 150px;
    height: auto;
}

/* Main */
main {
    max-width: 500px;
    width: 100vw;
    margin: 30px 0;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
    padding: 25px;
}

/* Titres */
h1 {
    text-align: center;
    color: #1f2937;
    font-size: 2rem;
    margin-top: 10px;
    font-weight: 600;
}

h2 {
    padding: 0;
    margin: 0;
}

h3.jeton-price {
    margin-bottom: 30px;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
}

h4 {
    font-size: 1rem;
    font-weight: 400;
    margin-top: 12px;
}

/* Boissons */
.boisson {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 10px 20px;
    background-color: #f3f4f6;
    border-radius: 12px;
    transition: transform 0.2s ease, background-color 0.3s ease;
}

.boisson:hover {
    background-color: #e5e7eb;
    transform: translateY(-3px);
}

.boisson h3 {
    margin: 0;
    font-weight: 500;
    color: #1f2937;
    flex-grow: 1;
}

.prix {
    padding-right: 1em;
    color: var(--color-blue);
    font-weight: bold;
}

.counter {
    display: flex;
    align-items: center;
    padding-left: 1em;
}

.counter button , #total button , .boisson button , .save button , button, a.return {
    padding: 12px 20px;
    background-color: var(--color-blue);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-decoration: none;
}

.counter button:hover , #total button:hover , .boisson button:hover , .save button:hover , .login button:hover , a.return:hover {
    transform: translateY(-2px);
}

.counter button:hover , #total .resume:hover , .boisson button:hover , .save button:hover , .login button:hover{
    background-color: var(--color-blue-hovered);
}

.counter input {
    width: 50px;
    text-align: center;
    border: none;
    background: none;
    font-size: 20px;
    color: #1f2937;
    font-weight: 600;
    margin: 0 0 0 15px;
    cursor: default;
}

/* Caution */
.caution-section {
    margin-top: 30px !important;
}

/* Total */
#total {
    margin: 30px 0 15px 0;
    text-align: center;
    font-size: 1.8rem;
    color: #111827;
    font-weight: 700;
}

#total-span {
    color: var(--color-blue);
}

#total button , a.return {
    margin-top: 30px;
    font-size: 20px;
    font-weight: 500;
    border: 1px solid var(--color-blue);
}

#total .resume:hover , a.return:hover {
    border: 1px solid var(--color-blue-hovered);
}

#total .remise-zero , a.return {
    color: var(--color-blue);
    background: none;
}

a.return {
    font-size: 18px;
}

/* Responsive */
@media (max-width: 600px) {
    main {
        margin: 15px 0;
        padding: 20px;
    }

    header #logo {
        width: 75px;
    }

    h1 {
        font-size: 1.6rem;
    }

    #total {
        font-size: 1.6rem;
    }

    #ticket .boisson-ticket span {
        font-size: 1.1rem;
    }
    
    .modal-content {
        padding: 25px !important;
    }
}

@media (max-width: 1400px) {
    .counter input {
        margin: 0 5px;
    }
}

/* Message d'erreur */
.error-message {
    color: var(--color-red);
    background-color: #f8d7da;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Styles pour la modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease, visibility 0.1s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    display: grid;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 30px 60px;
    border-radius: 10px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.7rem;
}

.modal-content h3 {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
    border: 1px dashed black;
    border-radius: 16px;
    padding: 10px;
    font-weight: 500;
}

.modal-content p {
    font-size: 1.7rem;
    font-weight: bold;
}

.modal-content p b {
    color: var(--color-blue);
}

.modal-content button {
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 500;
    background-color: var(--color-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.modal-content button:hover {
    background-color: var(--color-blue-hovered);
}

#ticket {
    text-align: left;
    margin-bottom: 20px;
}

#ticket .boisson-ticket {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

#ticket .boisson-ticket span {
    font-size: 1.2rem;
}

#ticket .boisson-ticket span:last-child {
    font-weight: 500;
}

.dotted-line {
    flex-grow: 1;
    border-bottom: 1px dotted lightgray;
    margin: 0 10px 5px 10px;
}

/* QR Code */
#scan-qr-button {
    width: 100%;
    height: 5rem;
    margin-bottom: 10px;
}

/* Logout Btn */
.logout-btn {
    padding: 12px 20px;
    background-color: var(--color-red);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
    
.logout-btn:hover {
    background-color: var(--color-red-hovered);
    transform: translateY(-2px);
}

/* Footer */
footer {
    width: 100%;
    color: var(--color-black);
    text-align: center;
    background-size: cover;
    padding: 20px 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

footer a {
    color: var(--color-black);
    text-decoration: none;
}

@media (max-width: 500px) {
    footer {
        flex-direction: column;
        justify-content: center;
        gap: 0.5rem;
    }
}
