/* ==================== VARIABLES CSS ==================== */
:root {
    --primary-color: #00bcd4;
    --secondary-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --text-primary: #333;
    --text-secondary: #666;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --border-radius: 12px;
}

/* ==================== RESET Y BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-color);
}

/* ==================== LOADER ==================== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    transition: bottom 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    bottom: 30px;
}

.toast.success {
    background: var(--secondary-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.info {
    background: var(--primary-color);
}

/* ==================== HEADER ==================== */
.header {
    background: white;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.header-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.header h1 {
    font-size: 24px;
    color: var(--primary-color);
    margin-top: 10px;
}

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
    padding: 20px;
}

.logo-container {
    text-align: center;
    padding: 10px 10px 10px;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.logo {
    width: 288px;
    height: 84px;
    /*object-fit: contain;*/
}

.logo-container h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin: 5px 0 5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-title {
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.login-title h2 {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.login-option {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.qr-display {
    background: #f8f9fa;
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 15px;
}

.qr-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.qr-display p {
    color: var(--text-secondary);
    font-size: 14px;
}

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #ddd;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    background: var(--bg-color);
    padding: 0 15px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== FORM ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==================== BUTTONS ==================== */
.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0097a7;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #388e3c;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    margin-bottom: 10px;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-exit {
    background: #757575;
    color: white;
}

.btn-exit:hover {
    background: #616161;
}

.btn-icon {
    font-size: 20px;
}

.login-footer {
    margin-top: 30px;
}

/* ==================== MENU SCREEN ==================== */
.menu-screen {
    padding: 0;
}

.welcome-message {
    background: white;
    padding: 30px 20px;
    text-align: center;
}

.welcome-message h2 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.menu-options {
    padding: 20px;
}

.menu-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.menu-card-exit {
    background: linear-gradient(135deg, #757575 0%, #616161 100%);
    color: white;
}

.menu-card-exit h3,
.menu-card-exit p {
    color: white;
}

.menu-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 12px;
    flex-shrink: 0;
}

.menu-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.icon-fallback {
    font-size: 32px;
}

.menu-card h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.menu-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==================== PUESTO SCREEN ==================== */
.puesto-screen {
    padding: 0;
}

.puesto-info {
    background: white;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.puesto-info h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.puesto-details {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 10px;
}

.puesto-details p {
    font-size: 14px;
    color: var(--text-secondary);
}

.puesto-options {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.puesto-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
}

.puesto-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.puesto-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 12px;
}

.puesto-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.puesto-card h3 {
    font-size: 15px;
    color: var(--text-primary);
}

.puesto-footer {
    padding: 20px;
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

#qrReader,
#qrReaderPuesto,
#qrReaderSalida {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.modal-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 15px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    .puesto-options {
        grid-template-columns: 1fr;
    }
    
    .menu-card {
        flex-direction: column;
        text-align: center;
    }
}