/* /var/www/origami2026-app/public/css/style.css */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --bg-color: #f3f4f6;
    --danger-color: #ef4444;
    --success-color: #10b981;
    
    --preview-bg-color: #ffffff;
    --preview-text-color: #1f2937;
    --preview-accent-color: #2563eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
html, body { background-color: var(--bg-color); color: #333; min-height: 100vh; display: flex; flex-direction: column; }

/* Navigation */
nav { background-color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); padding: 1rem; display: flex; justify-content: space-between; align-items: center; z-index: 100; flex-shrink: 0; }
.brand { font-size: 1.2rem; font-weight: bold; color: var(--primary-color); display: flex; align-items: center; gap: 10px; }
.nav-links { display: flex; gap: 5px; }
.nav-links button { background: none; border: none; padding: 0.5rem 1rem; cursor: pointer; font-size: 0.9rem; color: #666; transition: 0.3s; border-radius: 6px; white-space: nowrap; }
.nav-links button:hover, .nav-links button.active { background-color: #eff6ff; color: var(--primary-color); font-weight: bold; }
.nav-links button.btn-logout { color: var(--danger-color); margin-left: 10px; }

/* Main Container */
main { flex: 1; padding: 1rem; max-width: 1200px; margin: 0 auto; width: 100%; position: relative; }

/* Sections */
section { display: none; animation: fadeIn 0.3s ease-in-out; }
section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* UI Components */
.btn { padding: 0.6rem 1.2rem; border: none; border-radius: 6px; cursor: pointer; font-weight: 500; transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--secondary-color); }
.btn-danger { background-color: var(--danger-color); color: white; }
.btn-success { background-color: var(--success-color); color: white; }
.btn-outline { border: 1px solid #ccc; background: white; color: #333; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

.input-group { margin-bottom: 1rem; }
.input-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.85rem; }
.input-group input, .input-group select, .input-group textarea { width: 100%; padding: 0.7rem; border: 1px solid #ddd; border-radius: 6px; font-size: 0.95rem; }
.input-group input:focus { outline: none; border-color: var(--primary-color); }

/* Page: Search */
.search-container { text-align: center; margin-top: 2rem; }
.search-box { width: 100%; max-width: 700px; margin: 0 auto; position: relative; }
.search-box input { width: 100%; padding: 1.2rem 1.5rem 1.2rem 3rem; font-size: 1.1rem; border-radius: 50px; border: 2px solid #e5e7eb; box-shadow: 0 4px 6px rgba(0,0,0,0.05); outline: none; transition: 0.3s; }
.search-box input:focus { border-color: var(--primary-color); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); }
.search-box i { position: absolute; left: 1.5rem; top: 50%; transform: translateY(-50%); font-size: 1.2rem; color: #9ca3af; }
.search-results { margin-top: 2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

.user-card { background: white; padding: 1rem; border-radius: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); cursor: pointer; transition: 0.2s; border-left: 5px solid transparent; display: flex; gap: 1rem; align-items: center; }
.user-card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px rgba(0,0,0,0.1); border-left-color: var(--primary-color); }
.user-avatar { width: 50px; height: 50px; background: #e0e7ff; color: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: bold; flex-shrink: 0; }
.status-dot { height: 10px; width: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* Page: Preview Card */
.preview-wrapper { max-width: 450px; margin: 0 auto; perspective: 1000px; }
.id-card {
    background-color: var(--preview-bg-color); color: var(--preview-text-color);
    border-radius: 16px; overflow: hidden; box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex; flex-direction: column; position: relative; border: 1px solid #eee;
}
.id-card-header { background-color: var(--preview-accent-color); color: white; padding: 1.5rem 2rem; text-align: center; }
.id-card-logo { max-height: 50px; object-fit: contain; background: white; padding: 5px; border-radius: 4px; margin-bottom: 0.5rem; display: none; }
.id-card h2.event-name { font-size: 1.2rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.id-card-body { padding: 1.5rem; flex: 1; }
.profile-row { display: flex; gap: 1rem; margin-bottom: 1.5rem; border-bottom: 1px solid rgba(0,0,0,0.1); padding-bottom: 1rem; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(0,0,0,0.1); background: #ddd; }
.profile-details { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.profile-name { font-size: 1.3rem; font-weight: 700; line-height: 1.2; color: var(--preview-text-color); }
.profile-nik { font-size: 0.9rem; color: #666; font-family: monospace; margin-top: 4px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; font-size: 0.85rem; margin-bottom: 1.5rem; }
.info-item label { display: block; font-size: 0.75rem; color: #888; text-transform: uppercase; margin-bottom: 2px; }
.info-item span { font-weight: 600; }
.room-badge { background: rgba(0,0,0,0.05); padding: 0.8rem; border-radius: 8px; text-align: center; margin-bottom: 1.5rem; border: 1px dashed rgba(0,0,0,0.2); }
.room-number { font-size: 1.5rem; font-weight: 800; color: var(--preview-accent-color); display: block; }
.room-size { font-size: 1.25rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; }

.activity-log-container { margin-top: 1rem; background: rgba(0,0,0,0.03); padding: 0.8rem; border-radius: 8px; max-height: 120px; overflow-y: auto; }
.log-title { font-size: 0.75rem; font-weight: bold; color: #888; margin-bottom: 0.5rem; text-transform: uppercase; }
.log-item { font-size: 0.8rem; display: flex; justify-content: space-between; margin-bottom: 4px; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 2px; }

.preview-actions { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.preview-actions button { width: 100%; justify-content: center; }

/* Page: Database */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.header-actions { display: flex; gap: 0.5rem; }
.table-container { overflow-x: auto; background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
table { width: 100%; border-collapse: collapse; min-width: 800px; }
th, td { padding: 0.8rem; text-align: left; border-bottom: 1px solid #eee; font-size: 0.9rem; }
th { background-color: #f9fafb; font-weight: 600; color: #555; white-space: nowrap; }
tr:hover { background-color: #f8fafc; }

/* Page: Settings */
.settings-card { background: white; padding: 1.5rem; border-radius: 12px; height: fit-content; }
.preview-container { display: flex; align-items: center; justify-content: center; background: #e5e7eb; border-radius: 12px; padding: 2rem; }
.color-input { height: 40px; padding: 2px; width: 100%; }

/* Modals */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal.open { display: flex; }
.modal-content { background: white; padding: 2rem; border-radius: 12px; width: 100%; max-width: 500px; animation: slideDown 0.3s; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.modal-actions { margin-top: 1.5rem; display: flex; justify-content: flex-end; gap: 10px; }

/* Activity Grid */
.activity-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 1rem; }
.activity-option { padding: 10px; background: #f3f4f6; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; text-align: center; transition: 0.2s; }
.activity-option:hover { background: #e5e7eb; border-color: #999; }

/* Login Overlay */
.login-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #f3f4f6; z-index: 2000; display: flex; justify-content: center; align-items: center; }
.login-overlay.hidden { display: none; }
.login-box { background: white; padding: 2.5rem; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 100%; max-width: 400px; text-align: center; }
.brand-login { font-size: 1.5rem; color: var(--primary-color); margin-bottom: 2rem; font-weight: bold; display: flex; justify-content: center; align-items: center; gap: 10px; }

/* Toast */
.toast { position: fixed; bottom: 20px; right: 20px; padding: 1rem 1.5rem; background: #333; color: white; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transform: translateY(100px); transition: 0.3s; z-index: 3000; font-weight: 500; }
.toast.show { transform: translateY(0); }
.toast.success { background: var(--success-color); }
.toast.error { background: var(--danger-color); }

/* Responsive */
@media (max-width: 768px) {
    nav { padding: 0.5rem 1rem; flex-direction: column; gap: 0.5rem; }
    .brand { font-size: 1rem; }
    .nav-links { width: 100%; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
    .info-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .header-actions { width: 100%; overflow-x: auto; }
}

/* =========================
   SCAN BUTTON
========================= */

.search-toolbar{
    display:flex;
    gap:15px;
    align-items:center;
    max-width:900px;
    margin:auto;
}

.search-toolbar .search-box{
    flex:1;
}

.scan-btn{
    height:64px;
    min-width:120px;
    border:none;
    border-radius:50px;
    background:linear-gradient(135deg,#2563eb,#1d4ed8);
    color:white;
    font-weight:bold;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    font-size:1rem;
    box-shadow:0 5px 15px rgba(37,99,235,.3);
}

.scan-btn:hover{
    transform:translateY(-2px);
}

/* =========================
   SCANNER
========================= */

.scanner-container{
    width:100%;
    max-width:700px;
    background:white;
    border-radius:16px;
    overflow:hidden;
}

.scanner-header{
    padding:15px 20px;
    background:#111827;
    color:white;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

#qr-reader{
    width:100%;
}

#qr-reader video{
    border-radius:0 !important;
}

.scanner-status{
    padding:15px;
    text-align:center;
    font-weight:600;
    background:#f3f4f6;
}

.scan-success{
    background:#10b981 !important;
    color:white;
}

.scan-error{
    background:#ef4444 !important;
    color:white;
}

@media(max-width:768px){

    .search-toolbar{
        flex-direction:column;
    }

    .scan-btn{
        width:100%;
    }

}

/* =========================
   TV MODE STYLES
========================= */

/* Sembunyikan Navbar saat mode TV aktif */
body.tv-mode-active nav {
    display: none;
}

/* Fullscreen untuk main container */
body.tv-mode-active main {
    height: 100vh;
    padding: 0;
    max-width: 100%;
    overflow: hidden;
    background: #000;
}

#tv-show {
    display: none; /* Hidden by default */
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    align-items: center;
    justify-content: center;
    position: relative;
}

#tv-show.active {
    display: flex;
}

/* Background Effect Pattern */
#tv-show::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('https://picsum.photos/seed/eventbg/1920/1080');
    background-size: cover;
    background-position: center;
    opacity: 0.05;
    z-index: 0;
}

.tv-container {
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1200px;
    width: 90%;
    /* Animasi masuk */
    animation: slideInTv 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideInTv {
    from { opacity: 0; transform: scale(0.95) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.tv-photo-wrapper {
    width: 350px;
    height: 350px;
    border-radius: 24px;
    overflow: hidden;
    border: 8px solid rgba(255,255,255,0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    background: #333;
    flex-shrink: 0;
}

.tv-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tv-info {
    flex: 1;
}

.tv-welcome {
    font-size: 1.8rem;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 1rem;
    font-weight: 800;
}

.tv-name {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tv-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 15px 40px;
    font-size: 1.8rem;
    color: #e2e8f0;
}

.tv-label {
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1.4rem;
}

.tv-status {
    margin-top: 3rem;
    display: inline-block;
    padding: 1rem 3rem;
    background: #10b981;
    color: white;
    border-radius: 100px;
    font-size: 2.5rem;
    font-weight: 800;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Tombol Keluar (Overlay) */
.tv-overlay-controls {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

#tv-show:hover .tv-overlay-controls {
    opacity: 1;
}

.btn-tv-exit {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    font-size: 1rem;
    font-weight: bold;
}
.btn-tv-exit:hover { background: rgba(255, 255, 255, 0.2); }

/* Responsif untuk Layar Kecil (Tablet/HP) */
@media (max-width: 900px) {
    .tv-container { flex-direction: column; text-align: center; gap: 2rem; }
    .tv-details { grid-template-columns: 1fr; gap: 5px; font-size: 1.2rem; }
    .tv-name { font-size: 2.5rem; }
    .tv-photo-wrapper { width: 200px; height: 200px; }
    .tv-welcome { font-size: 1.2rem; }
}