/* Reset and global styles */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }

body { min-height: 100vh; background-color: #0d1117; color: #ffffff; display: flex; justify-content: center; align-items: center; overflow: hidden; position: relative; }

/* Background */
.background-blobs { position: absolute; inset: 0; z-index: 0; overflow: hidden; filter: blur(80px); }
.blob { position: absolute; border-radius: 50%; animation: float 20s infinite ease-in-out alternate; opacity: 0.6; }
.blob-1 { width: 300px; height: 300px; background: linear-gradient(135deg, #00f0ff, #0051ff); top: 10%; left: -10%; }
.blob-2 { width: 400px; height: 400px; background: linear-gradient(135deg, #ff0076, #7a00ff); bottom: -10%; right: -10%; animation-delay: -10s; }

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

/* Container - default Mobile */
.container { width: 100%; max-width: 420px; padding: 30px 20px; z-index: 10; position: relative; border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; gap: 20px; max-height: 98vh; overflow-y: auto; }

/* Header & Tabs */
header { text-align: center; display: flex; flex-direction: column; align-items: center; margin-bottom: 5px; position: relative; }
.logo-circle { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #00f0ff, #0051ff); display: flex; justify-content: center; align-items: center; font-size: 24px; margin-bottom: 15px; box-shadow: 0 10px 20px rgba(0, 81, 255, 0.4); }
h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; background: linear-gradient(to right, #fff, #a0aec0); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
header p { color: #a0aec0; font-size: 14px; margin-bottom: 10px; }
.logout-btn { position: absolute; top: 0; right: 0; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #ef4444; width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: all 0.3s ease; }
.logout-btn:hover { background: #ef4444; color: #fff; box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }

.tabs { display: flex; background: rgba(15, 23, 42, 0.6); border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); padding: 6px; width: 100%; gap: 4px; }
.tab-btn { flex: 1; background: transparent; border: none; color: #a0aec0; font-size: 16px; font-weight: 600; padding: 10px 0; border-radius: 8px; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tab-btn.active { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

/* Main Forms Content Wrapper - Mobile Logic */
.content-wrapper { display: flex; flex-direction: column; width: 100%; }
form { display: flex; flex-direction: column; gap: 20px; }

.tab-content { display: flex; flex-direction: column; gap: 15px; }
.tab-content:not(.active) { display: none !important; }

/* PC specific helpers hidden on mobile */
.on-pc-only { display: none !important; }
.form-title { font-size: 18px; font-weight: 600; color: #fff; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; gap: 10px; }

/* Form Basics */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.filters-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; width: 100%; }
label { font-size: 13px; font-weight: 500; color: #e2e8f0; display: flex; align-items: center; gap: 6px; }
label i { color: #00f0ff; width: 14px; text-align: center; }

/* Inputs */
.select-wrapper { position: relative; }
select, input[type="text"], input[type="password"], input[type="date"] { width: 100%; background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); color: #fff; padding: 14px 16px; border-radius: 12px; font-size: 15px; transition: all 0.3s ease; outline: none; appearance: none; -webkit-appearance: none; }
select:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="date"]:focus { border-color: #00f0ff; box-shadow: 0 0 15px rgba(0, 240, 255, 0.2); background: rgba(15, 23, 42, 0.8); }
select option { background-color: #1e293b; color: #fff; }
.arrow-down { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #a0aec0; pointer-events: none; }

/* Toggle */
.toggle-group { display: flex; background: rgba(15, 23, 42, 0.6); border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); padding: 4px; gap: 4px; }
.toggle-group input[type="radio"] { display: none; }
.toggle-btn { flex: 1; text-align: center; padding: 10px 0; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 600; color: #a0aec0; transition: all 0.3s ease; margin: 0; display: block; }
.toggle-small { padding: 8px 0; font-size: 14px; }
.toggle-group input[type="radio"]:checked + .toggle-btn { color: #fff; background: linear-gradient(135deg, #00f0ff, #0051ff); box-shadow: 0 4px 15px rgba(0, 81, 255, 0.3); }

/* Buttons */
.submit-btn { background: linear-gradient(135deg, #ff0076, #7a00ff); color: #fff; border: none; border-radius: 12px; padding: 16px; font-size: 18px; font-weight: 600; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 12px; transition: all 0.3s ease; box-shadow: 0 10px 25px rgba(255, 0, 118, 0.3); margin-top: 5px; }
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 15px 35px rgba(255, 0, 118, 0.4); }
.submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.export-buttons-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 5px; }
.action-btn { border: none; border-radius: 12px; padding: 12px 10px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; transition: all 0.3s ease; color: #fff; }
.action-btn i { font-size: 18px; }
.text-btn { background: rgba(71, 85, 105, 0.8); border: 1px solid rgba(255,255,255,0.1); }
.pdf-btn { background: rgba(239, 68, 68, 0.8); border: 1px solid rgba(255,255,255,0.1); }
.excel-btn { background: rgba(16, 185, 129, 0.8); border: 1px solid rgba(255,255,255,0.1); }
.action-btn:hover { transform: translateY(-2px); filter: brightness(1.2); }

/* Records List Viewer */
.records-list-wrapper { width: 100%; height: 260px; background: rgba(15, 23, 42, 0.5); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.records-list-wrapper::-webkit-scrollbar { width: 6px; }
.records-list-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.record-card { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); padding: 12px 14px; border-radius: 8px; display: flex; flex-direction: column; gap: 6px; transition: transform 0.2s ease; }
.record-card:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-1px); }
.rc-header { display: flex; justify-content: space-between; align-items: center; }
.rc-serial { font-weight: 700; font-size: 16px; color: #fff; letter-spacing: 0.5px; }
.rc-type { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 12px; text-transform: uppercase; margin-left: 8px; }
.badge-dtv { background: rgba(0, 240, 255, 0.2); color: #00f0ff; }
.badge-lte { background: rgba(255, 0, 118, 0.2); color: #ff0076; }
.rc-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #94a3b8; }
.rc-shop { display: flex; align-items: center; gap: 4px; }
.empty-state { text-align: center; color: #64748b; font-size: 14px; margin: auto; padding: 20px; }

/* Toast */
.toast { position: fixed; bottom: -80px; left: 50%; transform: translateX(-50%); background: rgba(15, 23, 42, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); padding: 14px 24px; border-radius: 50px; display: flex; align-items: center; gap: 12px; opacity: 0; transition: all 0.4s ease; z-index: 1000; white-space: nowrap; }
.toast.show { bottom: 30px; opacity: 1; }
.toast.error .icon-success { display: none; }
.toast.error::before { content: '\f071'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: #f87171; }
.icon-success { color: #4ade80; font-size: 20px; }

input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }

/* Scanner & Input Button */
.input-with-button { display: flex; gap: 10px; width: 100%; }
.input-with-button input { flex: 1; min-width: 0; }
.scan-btn { background: rgba(0, 240, 255, 0.1); border: 1px solid rgba(0, 240, 255, 0.3); color: #00f0ff; border-radius: 12px; width: 54px; flex-shrink: 0; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: all 0.3s ease; font-size: 20px; }
.scan-btn:hover { background: rgba(0, 240, 255, 0.3); box-shadow: 0 0 15px rgba(0,240,255,0.4); }

.scanner-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 2000; display: flex; justify-content: center; align-items: center; padding: 20px; backdrop-filter: blur(10px); }
.scanner-content { width: 100%; max-width: 400px; background: #0f172a; border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.scanner-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: #1e293b; border-bottom: 1px solid rgba(255,255,255,0.05); }
.scanner-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.scanner-header button { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 50%; width: 32px; height: 32px; color: #ef4444; font-size: 16px; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.2s; }
.scanner-header button:hover { background: #ef4444; color: #fff; }
#reader { width: 100%; min-height: 250px; background: #000; }
#reader video { object-fit: cover !important; }

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 480px) {
    .container { border-radius: 0; border: none; min-height: 100vh; padding: 30px 20px; max-height: none; }
    .records-list-wrapper { flex-grow: 1; }
}

@media (min-width: 768px) {
    .container { max-width: 900px; padding: 40px; }
    .tabs { display: none !important; }
    header { margin-bottom: 25px; }
    
    .content-wrapper { display: flex; flex-direction: row; gap: 40px; align-items: stretch; }
    
    .tab-content, .tab-content:not(.active) { display: flex !important; flex: 1; min-width: 0; gap: 20px; }
    
    .divider { width: 1px; background: rgba(255, 255, 255, 0.1); flex-shrink: 0; }
    
    .on-pc-only { display: flex !important; }
    
    .records-list-wrapper { height: 350px; }
}
