/* =================================================================== */
/*                         GENERAL & DESKTOP STYLES                    */
/* =================================================================== */

/* General Body & Elegant Theme */
body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
}
.logo {
    max-width: 200px;
    height: auto;
}

/* Forms */
.elegant-form h3 {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
}
.elegant-form input[type="text"],
.elegant-form input[type="email"],
.elegant-form input[type="password"],
.elegant-form input[type="tel"],
.elegant-form input[type="number"],
.elegant-form input[type="file"],
.elegant-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}
.elegant-form input:focus, .elegant-form textarea:focus {
    border-color: #007bff;
    outline: none;
}

/* --- NEW RULE TO FIX LABEL ALIGNMENT --- */
.elegant-form label {
    display: block; /* Force the label to take up the full width */
    margin-bottom: 5px; /* Add a little space between the label and its input */
    font-weight: bold; /* Make labels easier to read */
    color: #444;
}

.elegant-form button, .button {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}
.elegant-form button:hover, .button:hover {
    background-color: #0056b3;
}
.elegant-form small {
    display: block;
    margin-top: -10px;
    margin-bottom: 10px;
    color: #777;
}

/* Links and Buttons */
a { color: #007bff; text-decoration: none; }
a:hover { text-decoration: underline; }
.delete-link { color: #dc3545; display: block; text-align: center; margin-top: 20px; }
.footer-links { text-align: center; margin-top: 20px; border-top: 1px solid #eee; padding-top: 15px; }
.footer-links a { margin: 0 10px; }

/* Dashboard Specifics */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; }
.tier-image-container { text-align: center; margin: 20px 0; }
.tier-image-container img { max-width: 100%; border-radius: 8px; }
.points-display, .tier-display { text-align: center; margin: 10px 0; font-size: 1.2em; }
.points-display span { font-weight: bold; color: #28a745; }
.qr-code-container { text-align: center; margin-top: 20px; }
.dashboard-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Admin Table */
.customer-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.customer-table th, .customer-table td { border: 1px solid #ddd; padding: 12px; text-align: left; }
.customer-table th { background-color: #f8f9fa; }
.customer-table tr:nth-child(even) { background-color: #f2f2f2; }
.customer-table .actions a { margin-right: 10px; }

/* Utilities */
.error { color: #dc3545; text-align: center; background-color: #f8d7da; padding: 10px; border-radius: 4px; margin-bottom: 15px; }
.language-switcher { text-align: center; margin-bottom: 20px; }

/* Feedback Messages for Waiter/Admin pages */
.feedback { padding: 15px; margin-bottom: 20px; border-radius: 4px; font-weight: bold; text-align: center; }
.feedback.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.feedback.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }


/* =================================================================== */
/*                         WAITER PAGE STYLES                          */
/* =================================================================== */

#qr-reader {
    width: 100%;
    max-width: 500px; /* A sensible max width for desktop */
    margin: 20px auto;
    border: 1px solid #ccc;
    border-radius: 8px;
}

/* Customer Info Display for Waiter Page */
#customer-info-display {
    display: none; /* Hidden by default */
    padding: 15px;
    margin: 10px 0;
    font-size: 22px; /* Large font */
    font-weight: bold;
    text-align: center;
    line-height: 1.5; /* Adds nice spacing between the lines */
}
#customer-info-display.success { color: #155724; }
#customer-info-display.error { color: #721c24; }


/* =================================================================== */
/*                      MOBILE RESPONSIVE STYLES                       */
/* =================================================================== */

/* This applies to all screens smaller than 768px (tablets and phones) */
@media (max-width: 768px) {

    /* Make the body have no padding, so the container can be full-width */
    body {
        padding: 0 !important;
    }

    /* Make the container the main element, not a floating box */
    .container {
        width: 100% !important;
        max-width: none !important; /* Remove the desktop max-width */
        padding: 15px !important;   /* Adjust padding for mobile */
        box-shadow: none !important;  /* Remove the shadow on mobile */
        border-radius: 0 !important;  /* Remove rounded corners for a full-screen feel */
        min-height: 100vh !important; /* Ensure it takes up the full height of the screen */
        box-sizing: border-box !important; /* Ensure padding is included in the width */
    }

    h1 { font-size: 24px !important; }
    h2 { font-size: 20px !important; }

    /* --- ADMIN TABLE STACKING --- */
    .customer-table thead {
        border: none; clip: rect(0 0 0 0); height: 1px; margin: -1px;
        overflow: hidden; padding: 0; position: absolute; width: 1px;
    }
    .customer-table tr { display: block; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 4px; }
    .customer-table td { display: block; text-align: right; border-bottom: 1px dotted #ccc; }
    .customer-table td::before { content: attr(data-label); float: left; font-weight: bold; text-align: left; }
    .customer-table td:last-child { border-bottom: 0; }
}