/* ==========================================================================
   VOX CONECTA - CONSOLIDATED SERVICES DESIGN SYSTEM
   Targets: administrator, conecta-admin, fastpass, installer, visitor
   ========================================================================== */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.1);
    --primary-rgb: 99, 102, 241;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- REGISTRATION & VISITOR SPECIFIC --- */
#regClientName {
    margin-bottom: 24px;
    font-weight: 600;
    color: var(--primary);
    font-size: 1.2rem;
    padding: 16px;
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px dashed var(--primary);
    border-radius: 5px;
    text-align: center;
}

.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-message svg {
    width: 64px;
    height: 64px;
    fill: var(--success);
    margin-bottom: 20px;
}

.dynamic-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 14px;
    color: var(--text-main);
    font-weight: 600;
    transition: all 0.2s;
    width: 100%;
    min-width: 0;
}

.dynamic-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.p-description {
    color: var(--text-main);
    font-weight: 600;
    margin-top: -20px;
    margin-bottom: 24px;
    font-size: 1.1rem;
    display: none;
}

.dynamic-buttons-container {
    display: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    gap: 12px;
    overflow-x: hidden;
}

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

.mt-32 { margin-top: 32px; }
.text-center { text-align: center; }
.error-text { color: var(--danger); }

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Multi-page Layout Variations */
body.full-height {
    display: block;
    height: 100vh;
    overflow: hidden;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

/* Custom Scrollbar for Containers */
.container::-webkit-scrollbar, .main-content::-webkit-scrollbar {
    width: 6px;
}

.container::-webkit-scrollbar-thumb, .main-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
}

/* --- HEADER & FOOTER --- */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, var(--bg-dark), transparent);
    z-index: 100;
}

.top-header img {
    height: 2rem;
    width: auto;
}

.bottom-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, var(--bg-dark), transparent);
    z-index: 100;
}

/* --- TYPOGRAPHY --- */
h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

/* --- INTERACTIVE ELEMENTS --- */
.controls {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.controls button {
    width: 100%;
}

button {
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    width: auto;
    min-width: 140px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.list-action-btn {
    width: auto;
    min-width: auto;
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.list-action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: none;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Button Variants */
.btn-primary, #callBtn, #scanBtn {
    background: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled), #callBtn:hover:not(:disabled), #scanBtn:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

#hangupBtn {
    background: var(--danger);
}

#hangupBtn:hover:not(:disabled) {
    background: #dc2626;
}

#submitBtn, #saveAllBtn {
    background: var(--success);
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 16px;
    transition: color 0.2s;
    width: auto;
    display: inline-block;
}

.link-btn:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    transform: none;
}

/* --- FORMS --- */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 600;
}

.form-control, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}

.form-control:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.form-control[readonly], .form-control:disabled {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    cursor: not-allowed;
    opacity: 0.9;
}

select option {
    background: var(--bg-dark);
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.flex-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

/* --- STATUS & ALERTS --- */
#status-card {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 5px;
    padding: 16px;
    margin: 0 auto;
    max-width: 480px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.status-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 4px;
    display: block;
}

.pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    margin-right: 8px;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.alert {
    padding: 12px 16px;
    border-radius: 5px;
    margin-bottom: 16px;
    display: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.alert.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* --- LISTS --- */
.list-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 24px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 4px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.75rem;
    margin-left: 8px;
    font-weight: 600;
}

/* --- TABLES --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
}

.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.data-table th {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* --- QR SCANNER (Fastpass/Installer) --- */
#reader-container {
    margin-bottom: 20px;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    padding: 10px;
}

#reader {
    width: 100%;
}

#reader__dashboard_section_csr span {
    color: #333;
}

/* --- DASHBOARD LAYOUT (Conecta-admin) --- */
#sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.9);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
}

.sidebar-header {
    padding: 0 24px 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
}

.menu-item {
    padding: 14px 24px;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
    text-align: left;
    width: 100%;
    border-left: 4px solid transparent;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.menu-item:hover, .menu-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.content-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 32px;
    backdrop-filter: blur(12px);
    margin-bottom: 24px;
}

.global-header {
    background: rgba(15, 23, 42, 0.95);
    padding: 16px 24px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 5px;
    /*position: sticky;*/
    top: 0px;
    z-index: 10;
}

/* --- SPECIAL ACTIONS --- */
.level-zero-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 16px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
}

.level-zero-btn:active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    transform: scale(0.98);
}

.level-zero-btn svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* --- ANIMATIONS --- */
.view-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view-section.active {
    display: block;
}

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

/* --- CONECTA-ADMIN SPECIFIC --- */
#login-view {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
}

#login-view .container {
    width: 100%;
    max-width: 450px;
}

#dashboard-view {
    display: none;
    height: 100vh;
    width: 100%;
}

#dashboard-view.active {
    display: flex;
}

.sidebar-header img {
    max-width: 160px;
}

.data-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 5px;
    min-width: auto;
}

h2.title {
    margin-bottom: 24px;
    font-size: 1.8rem;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
}
/* --- MODAL OVERLAY --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    z-index: 11000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: calc(env(safe-area-inset-top) + 20px) 20px 20px 20px;
    overflow-y: auto;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-footer {
    margin-top: auto;
    padding-top: 20px;
    width: 100%;
    max-width: 480px;
}
