/* Variables de Color (basadas en preferencias: #0D9488 Teal, #374151 Grey, Blanco, #D9E3F7 Light Blue) */
:root {
    --bg-dark: #111827;
    --dark-grey: #374151;
    --teal-primary: #0D9488;
    --teal-hover: #0F766E;
    --light-blue: #D9E3F7;
    --white: #ffffff;
    --white-transparent: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.15);
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --error: #EF4444;
    --success: #10B981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Formas de Fondo dinámicas (Animadas) */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 15s infinite alternate ease-in-out;
}

.shape-1 {
    width: 40vw;
    height: 40vw;
    background: var(--teal-primary);
    top: -10%;
    left: -10%;
}

.shape-2 {
    width: 30vw;
    height: 30vw;
    background: var(--dark-grey);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.shape-3 {
    width: 25vw;
    height: 25vw;
    background: var(--light-blue);
    opacity: 0.2;
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--white-transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 2.5rem;
}

/* Contenedores de Vistas */
.view {
    display: none;
    min-height: 100vh;
    width: 100%;
}
.view.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -- LOGIN PANTALLA -- */
#login-view {
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.brand h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -1px;
}

.brand span {
    color: var(--teal-primary);
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: block;
    margin-bottom: 2rem;
}

.login-card h3 {
    margin-bottom: 1.5rem;
    color: var(--light-blue);
    font-weight: 400;
}

/* Formularios Generales */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: var(--white);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--teal-primary);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.3);
}

select option {
    background: var(--dark-grey);
    color: var(--white);
}

textarea {
    resize: vertical;
    font-family: inherit;
}

.primary-btn {
    width: 100%;
    background: var(--teal-primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.primary-btn:hover {
    background: var(--teal-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.3);
}

.primary-btn:disabled {
    background: var(--dark-grey);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* -- DASHBOARD PANTALLA -- */
.glass-nav {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand-sm h2 {
    font-size: 1.5rem;
    display: inline;
    color: var(--white);
}
.brand-sm span {
    color: var(--teal-primary);
    margin-left: 5px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.text-btn:hover {
    color: var(--white);
}

.content-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.dashboard-card {
    width: 100%;
    max-width: 600px;
}

.card-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
}

.card-header h3 {
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Utilities */
.hidden { display: none !important; }

.error-text {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.feedback-msg {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
}

.feedback-msg.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.feedback-msg.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Choice Box (Roles) */
.choice-box {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.choice-card {
    flex: 1;
    position: relative;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.choice-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.choice-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.choice-card .icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    transition: filter 0.3s ease;
}

.choice-card .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.choice-card .value {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Colores Específicos para Hover y Checked */
.choice-card.bronze input:checked ~ .icon {
    filter: drop-shadow(0 0 8px rgba(205, 127, 50, 0.6));
}
.choice-card.bronze:has(input:checked) {
    border-color: #cd7f32;
    background: rgba(205, 127, 50, 0.1);
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.2);
}

.choice-card.silver input:checked ~ .icon {
    filter: drop-shadow(0 0 8px rgba(192, 192, 192, 0.6));
}
.choice-card.silver:has(input:checked) {
    border-color: #c0c0c0;
    background: rgba(192, 192, 192, 0.1);
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.2);
}

.choice-card.gold input:checked ~ .icon {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.choice-card.gold:has(input:checked) {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* Autocomplete/Search Employee component */
.autocomplete-container {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    z-index: 100;
    list-style: none;
    margin-top: 5px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.8);
}

.autocomplete-list li {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--white);
    transition: background 0.2s, color 0.2s;
    font-size: 0.95rem;
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li.no-results {
    color: var(--text-secondary);
    font-style: italic;
    cursor: default;
}
.autocomplete-list li.no-results:hover {
    background: transparent;
}

.autocomplete-list li:hover:not(.no-results) {
    background: var(--teal-hover);
    color: #fff;
}

/* Custom scrollbar for webkit */
.autocomplete-list::-webkit-scrollbar {
    width: 6px;
}
.autocomplete-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2); 
    border-radius: 8px;
}
.autocomplete-list::-webkit-scrollbar-thumb {
    background: var(--teal-primary); 
    border-radius: 8px;
}
/* QR Scanner Integration */
.search-with-qr {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.qr-btn {
    background: var(--white-transparent);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
}

.qr-btn:hover {
    background: var(--teal-primary);
    border-color: var(--teal-primary);
    transform: scale(1.05);
}

.qr-btn .icon {
    font-size: 1.2rem;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    max-width: 500px;
    width: 100%;
    position: relative;
    padding: 1.5rem !important;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--white);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 1;
}

#qr-reader {
    width: 100% !important;
    border: none !important;
    border-radius: 12px;
    overflow: hidden;
}

#qr-reader__scan_region {
    background: rgba(0, 0, 0, 0.3) !important;
}

#qr-reader video {
    border-radius: 12px;
}

.modal-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Override html5-qrcode styles for better aesthetics */
#qr-reader__status_span {
    display: none !important;
}

button[id^="html5-qrcode-button"] {
    background: var(--teal-primary) !important;
    border: none !important;
    color: white !important;
    padding: 0.6rem 1.2rem !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    margin: 5px !important;
}
