/* public/css/index.css */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { background: #000; color: #fff; height: 100dvh; overflow: hidden; font-family: 'Segoe UI', Tahoma, sans-serif; user-select: none; }

#mainNav { position: fixed; top: 0; left: 0; right: 0; height: 50px; background: #00416A; z-index: 100; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; border-bottom: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(5px); }
.nav-brand { font-size: 16px; font-weight: 800; color: #E4E5E6; letter-spacing: 1px; }
.nav-btn { background: #E4E5E6; color: #00416A; border: none; border-radius: 6px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.nav-btn:active { background: #cfd1d3; }

.sync-btn { background: #f39c12 !important; color: #fff !important; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(243, 156, 18, 0); } 100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0); } }

#video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 10; transition: opacity 0.06s ease; }

#topbar { position: fixed; top: 50px; left: 0; right: 0; padding: 12px 14px; background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%); z-index: 20; display: flex; align-items: center; gap: 10px; }
#containerWrap { flex: 1; display: flex; flex-direction: column; gap: 2px; }
#containerLabel { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,0.65); text-transform: uppercase; }
#containerInput { background: rgba(255,255,255,0.18); border: 1.5px solid rgba(255,255,255,0.45); border-radius: 8px; color: #fff; padding: 8px 12px; font-size: 15px; font-weight: 700; width: 100%; outline: none; }
#containerInput:focus { border-color: #E4E5E6; }

#customSuggestions { display: none; position: absolute; top: 100%; left: 0; right: 0; background: rgba(0, 45, 74, 0.95); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; max-height: 220px; overflow-y: auto; z-index: 100; margin-top: 4px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); backdrop-filter: blur(5px); }
.suggestion-item { padding: 12px 15px; color: #fff; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; }
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:active, .suggestion-item:hover { background: rgba(0, 168, 255, 0.4); }

#zoomContainer { display: none; position: fixed; top: 50%; left: 15px; transform: translateY(-50%); z-index: 50; flex-direction: column; align-items: center; gap: 12px; background: rgba(0,0,0,0.6); padding: 20px 8px; border-radius: 25px; backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.1); }
#zoomSlider { -webkit-appearance: slider-vertical; appearance: slider-vertical; accent-color: #00c6ff; width: 8px; height: 180px; border-radius: 2px; outline: none; }

#controls { position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 14px 20px; background: linear-gradient(to top, rgba(0,0,0,0.88) 80%, rgba(0,0,0,0) 100%); z-index: 20; }

#commentWrap { display: none; margin-bottom: 12px; }
#commentInput { width: 100%; background: rgba(255,255,255,0.18); border: 1.5px solid rgba(255,255,255,0.45); border-radius: 8px; color: #fff; padding: 10px 12px; font-size: 14px; outline: none; transition: border-color 0.2s; }
#commentInput:focus { border-color: #00c6ff; background: rgba(255,255,255,0.25); }
#commentInput::placeholder { color: rgba(255,255,255,0.6); }

#thumbStrip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; scrollbar-width: none; }
#thumbStrip::-webkit-scrollbar { display: none; }
#thumbStrip:empty { display: none; }
.thumb { position: relative; flex-shrink: 0; }
.thumb img { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; border: 2px solid rgba(255,255,255,0.3); display: block; cursor: pointer; }
.thumb .num { position: absolute; bottom: 3px; left: 3px; background: rgba(0,0,0,0.65); color: #fff; font-size: 9px; font-weight: 700; border-radius: 3px; padding: 1px 4px; }
.thumb .del { position: absolute; top: -5px; right: -5px; background: #e53e3e; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid #000; font-weight: 700; }

#btnRow { display: flex; align-items: center; justify-content: center; position: relative; height: 80px; width: 100%; }

#switchCamBtn { position: absolute; left: 0; width: 45px; height: 45px; background: transparent; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.1s; z-index: 2; }
#switchCamBtn:active { transform: scale(0.88); }
#clearBtn { position: absolute; left: 50px; width: 45px; height: 45px; background: transparent; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.1s; }
#clearBtn:active { transform: scale(0.88); }

#uploadBtn { position: absolute; left: calc(50% - 100px); width: 45px; height: 45px; background: transparent; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 2; transition: transform 0.1s; }
#uploadBtn:active { transform: scale(0.88); }

#shutter { position: relative; width: 70px; height: 70px; background: transparent; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.08s; flex-shrink: 0; z-index: 2; }
#shutter::before { content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 3px; background: linear-gradient(135deg, #00c6ff, #0072ff); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
#shutter:active { transform: scale(0.88); }

.icon-gradient { background: linear-gradient(135deg, #00c6ff, #0072ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; }
#clearBtn .material-symbols-outlined, #uploadBtn .material-symbols-outlined { font-size: 30px; }
#shutter .material-symbols-outlined { font-size: 42px; }

#saveBtn { position: absolute; right: 0; max-width: 90px; background: linear-gradient(135deg, #00416A, #E4E5E6); border: none; color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.6); padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 800; cursor: pointer; line-height: 1.2; text-align: center; }
#saveBtn:disabled { opacity: 0.38; cursor: not-allowed; }
.saveSub { font-size: 11px; font-weight: 600; opacity: 0.9; text-shadow: none; color: #000; display: block; margin-top: 2px; }

#syncOverlay, #successOverlay, #noCam, #confirmOverlay, #customAlertOverlay { display: none; position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; text-align: center; }
#syncOverlay { background: rgba(0,45,74,0.95); flex-direction: column; padding: 32px; }
#syncOverlay.show { display: flex; }
.spinner { width: 56px; height: 56px; border: 5px solid rgba(255,255,255,0.15); border-top-color: #E4E5E6; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#successOverlay { background: rgba(0,0,0,0.88); flex-direction: column; gap: 12px; padding: 32px; }
#successOverlay.show { display: flex; }
.success-title { font-size: 22px; font-weight: 800; color: #E4E5E6; }
.success-info { font-size: 13px; color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.08); border-radius: 10px; padding: 12px 18px; line-height: 1.8; max-width: 320px; width: 100%; text-align: left; }
.success-info strong { color: #fff; }
#nextBtn { background: #00416A; color: #E4E5E6; border: none; border-radius: 12px; padding: 14px 32px; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 6px; }

#noCam { background: #111; flex-direction: column; gap: 12px; padding: 32px; z-index: 5; }
#noCam.show { display: flex; }

#confirmOverlay { background: rgba(0,0,0,0.75); padding: 20px; backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.2s ease; }
#confirmOverlay.show { display: flex; opacity: 1; }
.confirm-box { background: #E4E5E6; color: #00416A; border-radius: 16px; padding: 24px; max-width: 300px; width: 100%; box-shadow: 0 10px 25px rgba(0,0,0,0.3); transform: scale(0.9); transition: transform 0.2s ease; margin: auto; }
#confirmOverlay.show .confirm-box { transform: scale(1); }
.confirm-icon { font-size: 44px; color: #e53e3e; margin-bottom: 8px; line-height: 1; }
.confirm-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.confirm-desc { font-size: 13px; color: #4a5568; margin-bottom: 24px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions button { flex: 1; padding: 12px; border: none; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.15s; }
.btn-cancel { background: #cbd5e0; color: #4a5568; }
.btn-confirm { background: #e53e3e; color: #fff; }

#customAlertOverlay { background: rgba(0,0,0,0.8); padding: 20px; backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.2s ease; }
#customAlertOverlay.show { display: flex; opacity: 1; }
.alert-box { background: #1e1e2f; color: #fff; border-radius: 20px; padding: 30px 24px; max-width: 300px; width: 100%; box-shadow: 0 15px 35px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); transform: scale(0.9); transition: transform 0.2s ease; margin: auto; }
#customAlertOverlay.show .alert-box { transform: scale(1); }
.alert-icon .material-symbols-outlined { font-size: 54px; background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.alert-title { font-size: 20px; font-weight: 800; margin-bottom: 10px; letter-spacing: 0.5px; }
.alert-desc { font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 25px; line-height: 1.6; }
.btn-alert-ok { background: linear-gradient(135deg, #00c6ff, #0072ff); color: #fff; border: none; padding: 14px; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; width: 100%; letter-spacing: 1px; }

#logoutConfirmOverlay { display: none; position: fixed; inset: 0; background: rgba(0, 45, 74, 0.85); z-index: 999999; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s ease; backdrop-filter: blur(5px); }
#logoutConfirmOverlay.show { display: flex; opacity: 1; }
.logout-box { background: #fff; color: #002D4A; border-radius: 20px; padding: 32px 24px; max-width: 320px; width: 100%; box-shadow: 0 15px 35px rgba(0,0,0,0.4); transform: scale(0.9); transition: transform 0.2s ease; text-align: center; margin: auto; }
#logoutConfirmOverlay.show .logout-box { transform: scale(1); }
.logout-icon .material-symbols-outlined { font-size: 56px; color: #ff6b6b; margin-bottom: 10px; }
.logout-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; color: #002D4A; }
.logout-desc { font-size: 14px; color: #666; margin-bottom: 28px; line-height: 1.5; }
.logout-actions { display: flex; gap: 12px; }
.logout-actions button { flex: 1; padding: 14px; border: none; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; transition: 0.2s; }
.btn-logout-cancel { background: #f0f2f5; color: #555; }
.btn-logout-cancel:active { background: #e4e6e9; }
.btn-logout-confirm { background: #ff6b6b; color: #fff; }
.btn-logout-confirm:active { background: #e53e3e; }