/* Premium Design System - Dark Mode & Glassmorphism */
:root {
    --bg-base: #0a0b10;
    --bg-surface: rgba(20, 22, 33, 0.65);
    --bg-surface-opaque: #141621;
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: rgba(255, 255, 255, 0.2);
    
    --color-primary: #5c62f9;
    --color-primary-glow: rgba(92, 98, 249, 0.4);
    --color-success: #10b981;
    --color-success-glow: rgba(16, 185, 129, 0.3);
    --color-danger: #ef4444;
    --color-danger-glow: rgba(239, 68, 68, 0.3);
    --color-warning: #f59e0b;
    
    --color-premium: #d946ef;
    --color-premium-glow: rgba(217, 70, 239, 0.4);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #0f172a;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --blur-intensity: 16px;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(92, 98, 249, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(217, 70, 239, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 60px;    /* Top bar space */
    padding-bottom: 70px; /* Bottom nav space */
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(13, 14, 22, 0.85);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 10px;
}

.bottom-nav .menu-item {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 5px 0;
    transition: var(--transition-smooth);
    cursor: pointer;
    border-radius: 0;
    border-left: none;
    box-shadow: none;
}

.bottom-nav .menu-item i {
    font-size: 20px;
    transition: var(--transition-smooth);
}

.bottom-nav .menu-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.bottom-nav .menu-item.active {
    color: var(--text-main);
    background: transparent;
    border-top: 3px solid var(--color-primary);
    border-left: none;
    box-shadow: none;
}

.bottom-nav .menu-item.active i {
    color: var(--color-primary);
    text-shadow: 0 0 10px var(--color-primary-glow);
}

/* Header Brand and Profile Widgets (Fixed position) */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(13, 14, 22, 0.85);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    margin-bottom: 0;
    gap: 8px;
}

.brand-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.brand-mini .brand-icon {
    font-size: 20px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-premium));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px var(--color-primary-glow));
}

.brand-mini .brand-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-auth-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-user-profile {
    display: flex;
    flex-direction: row; /* column에서 row로 변경 */
    align-items: center;
    gap: 8px;
}

#header-user-email {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    max-width: 95px; /* 모바일 폭 제한 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#header-plan-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    cursor: pointer;
    align-self: center; /* row 정렬용 */
}

.user-badge-oval {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
}

.user-badge-oval i {
    color: var(--color-primary);
    font-size: 11px; /* 13px에서 11px로 축소 */
}

#plan-badge {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
}

.badge-free {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.badge-premium {
    background: linear-gradient(135deg, var(--color-premium), #ec4899);
    color: white;
    box-shadow: 0 0 10px var(--color-premium-glow);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 15px 24px 20px 24px;
    overflow-y: auto;
    height: calc(100vh - 130px);
}



.top-bar h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 28px;
    letter-spacing: -0.5px;
}

.status-indicator-group {
    display: flex;
    gap: 15px;
}

.status-indicator {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator i {
    font-size: 8px;
}

.status-indicator.active i {
    color: var(--color-success);
    text-shadow: 0 0 8px var(--color-success-glow);
}

.status-indicator.inactive i {
    color: var(--color-danger);
    text-shadow: 0 0 8px var(--color-danger-glow);
}

.status-indicator.pending i {
    color: var(--color-warning);
}

/* Card Styling (Glassmorphism) */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 25px;
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Dashboard Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* 기기 가로폭이 좁아지면 자동으로 1열/2열 정렬되도록 개선 */
    grid-gap: 25px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.total-in::before { background: var(--color-primary); }
.customer-in::before { background: var(--color-success); }
.staff-in::before { background: var(--color-premium); }

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.total-in .card-icon { background: rgba(92, 98, 249, 0.15); color: var(--color-primary); }
.customer-in .card-icon { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.staff-in .card-icon { background: rgba(217, 70, 239, 0.15); color: var(--color-premium); }

.stat-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 28px;
}

/* Chart & History Layout */
.chart-card {
    grid-column: 1 / -1; /* 대시보드 내 전체 너비를 꽉 채우도록 설정 */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.history-card {
    grid-column: 1 / -1; /* 찌그러지지 않고 대시보드 내 전체 너비를 꽉 채우도록 설정 */
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.history-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 5px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    font-size: 13px;
    animation: slideIn 0.3s ease-out;
}

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

.history-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.history-avatar.visitor {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.history-avatar.staff {
    background: rgba(217, 70, 239, 0.1);
    color: var(--color-premium);
}

.history-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-details span:first-child {
    font-weight: 600;
}

.history-details span:last-child {
    font-size: 11px;
    color: var(--text-muted);
}

.badge-premium-only {
    font-size: 11px;
    background: rgba(217, 70, 239, 0.15);
    color: var(--color-premium);
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 15px;
}

.empty-state i {
    font-size: 40px;
    opacity: 0.3;
}

/* Tabs Toggle */
.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Camera Workspace */
.camera-workspace {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 25px;
    height: calc(100vh - 150px);
}

.video-container {
    position: relative;
    padding: 0;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#overlay-canvas, #config-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

#config-canvas {
    z-index: 3;
    cursor: crosshair;
}

.setup-controls {
    position: relative;
    margin-top: 15px;
    z-index: 4;
    background: rgba(10, 11, 16, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass-focus);
    border-radius: var(--border-radius);
    padding: 12px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 100%;
    box-sizing: border-box;
}

.setup-tip {
    font-size: 13px;
    color: var(--text-muted);
}

.setup-buttons {
    display: flex;
    gap: 10px;
}

.camera-info-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.engine-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.debug-monitor {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.monitor-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.monitor-row span:last-child {
    font-weight: 700;
}

/* Settings List */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
}

.setting-desc h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.setting-desc p {
    font-size: 13px;
    color: var(--text-muted);
}

.setting-action-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Switch Toggle Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--border-glass);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
    background-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Staff Directory Grid */
.staff-card-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
    overflow-y: auto;
}

.staff-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.staff-card img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-premium);
    margin-bottom: 12px;
}

.staff-card-name {
    font-weight: 600;
    font-size: 14px;
}

.staff-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-delete-staff {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition-smooth);
}

.btn-delete-staff:hover {
    color: var(--color-danger);
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 8, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: var(--transition-smooth);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Mini stats board styling */
.mini-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}
.mini-stat-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.mini-stat-box .label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}
.mini-stat-box .value {
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-heading);
}
.mini-stat-box.total { border-color: rgba(92, 98, 249, 0.15); }
.mini-stat-box.total .value { color: #5c62f9; }
.mini-stat-box.visitor { border-color: rgba(16, 185, 129, 0.15); }
.mini-stat-box.visitor .value { color: #10b981; }
.mini-stat-box.staff { border-color: rgba(217, 70, 239, 0.15); }
.mini-stat-box.staff .value { color: #d946ef; }

.modal-content {
    background: var(--bg-surface-opaque);
    border: 1px solid var(--border-glass-focus);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-glass);
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 25px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Forms & Buttons */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.form-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: var(--transition-smooth);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(92, 98, 249, 0.2);
}

.btn {
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    transition: var(--transition-smooth);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: #4b52e0;
    box-shadow: 0 0 15px var(--color-primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.04);
}

.btn-outline.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-google {
    background: white;
    color: #1f2937;
}

.btn-google:hover {
    background: #f3f4f6;
}

.btn-premium {
    background: linear-gradient(135deg, var(--color-premium), #ec4899);
    color: white;
}

.btn-premium:hover {
    box-shadow: 0 0 15px var(--color-premium-glow);
}

.w-full {
    width: 100%;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-glass);
    margin: 20px 0;
}

/* Capture Setup Layout */
.capture-workspace {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.capture-preview-box {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    background: #000;
    border: 3px solid var(--border-glass);
}

#capture-webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#capture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.capture-status {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.capture-controls {
    display: flex;
    gap: 10px;
}

/* Premium Offer UI */
/* Premium Offer UI - Plans Grid */
.premium-plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

@media (max-width: 480px) {
    .premium-plans-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.premium-plan-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px 15px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.premium-plan-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.premium-plan-card.featured {
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.08), rgba(92, 98, 249, 0.05));
    border: 1px solid rgba(217, 70, 239, 0.25);
}

.premium-plan-card.featured:hover {
    border-color: rgba(217, 70, 239, 0.45);
    box-shadow: 0 0 15px var(--color-premium-glow);
}

.premium-plan-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-top: 15px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.plan-badge {
    font-size: 8px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.plan-badge.discount {
    background: linear-gradient(135deg, var(--color-premium), #ec4899);
    color: white;
    box-shadow: 0 0 8px var(--color-premium-glow);
}

.plan-price {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 15px;
    font-family: var(--font-heading);
}

.plan-price span {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.premium-features {
    text-align: left;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

.premium-features i {
    color: var(--color-premium);
    margin-right: 8px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
}

.profile-avatar {
    font-size: 50px;
    color: var(--color-primary);
}

.hidden {
    display: none !important;
}

/* Real-time configuration panel styles inside camera view */
.camera-info-panel .panel-section h2 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-main);
}

.mini-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.mini-setting-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.mini-setting-info h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.mini-setting-info p {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Compact switch toggle for sidebar panels */
.switch-sm {
    width: 40px;
    height: 22px;
}

.switch-sm .slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

input:checked + .switch-sm .slider:before {
    transform: translateX(18px);
}

/* Responsive Scaling for Android WebView */
@media (max-width: 1024px) {
    .modal-content {
        width: 95%;
        max-width: 360px;
    }
    .modal-header {
        padding: 12px 16px;
    }
    .modal-body {
        padding: 15px 16px;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .main-content {
        padding: 15px 20px 20px 20px;
    }
    
    .top-bar {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        padding: 0 10px;
    }

    .brand-mini .brand-name {
        font-size: 15px;
    }

    #header-user-email {
        max-width: 65px;
    }
    
    .grid-layout {
        grid-template-columns: 1fr;
        grid-gap: 15px;
    }
    
    .chart-card, .hourly-chart-card {
        grid-column: span 1;
    }

    .card {
        padding: 15px 12px;
    }

    .history-card {
        grid-column: span 1;
        max-height: 350px;
        padding: 15px 12px;
    }

    .history-list {
        padding-right: 0;
    }

    .history-item {
        padding: 10px 8px;
        gap: 8px;
        font-size: 12px;
    }

    .history-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    
    .camera-workspace {
        grid-template-columns: 1fr;
        height: auto;
    }

    .setup-controls {
        position: relative;
        margin-top: 15px;
        width: 100%;
        max-width: none;
        border-radius: var(--border-radius);
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: center;
        text-align: center;
    }
    
    .setup-tip {
        font-size: 11px;
        line-height: 1.4;
    }
    
    .setup-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .setup-buttons .btn {
        padding: 8px 4px;
        font-size: 11px;
        white-space: nowrap;
    }
}

/* Camera loading overlay */
.camera-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 16, 0.85);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--text-main);
    font-family: var(--font-body);
    transition: var(--transition-smooth);
}

.loading-icon {
    font-size: 32px;
    color: var(--color-primary);
}

/* Toast Notification Styling */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%, 50px);
    background: rgba(10, 11, 16, 0.9);
    backdrop-filter: blur(10px);
    color: var(--text-main);
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 13px;
    font-family: var(--font-body);
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-glass-focus);
}
.toast-message.success {
    border-color: rgba(16, 185, 129, 0.4);
}
.toast-message.success i {
    color: #10b981; /* Emerald Green icon */
}
.toast-message.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

/* Login Gate Styling */
.login-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(92, 98, 249, 0.25) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(217, 70, 239, 0.15) 0px, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-gate.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-gate-box {
    width: 90%;
    max-width: 440px;
    padding: 40px;
    background: rgba(20, 22, 33, 0.55);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass-focus);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    text-align: center;
    animation: gateFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-gate-brand {
    margin-bottom: 35px;
}

.brand-icon-large {
    font-size: 56px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-premium));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(92, 98, 249, 0.3));
}

.login-gate-brand h2 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 28px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-gate-brand p {
    font-size: 14px;
    color: var(--text-muted);
}

.btn-lg {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
}

.w-full {
    width: 100%;
}

/* Premium Lock Overlay */
.premium-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 16, 0.82);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.premium-lock-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lock-content {
    text-align: center;
    max-width: 320px;
    padding: 20px;
    animation: lockPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes lockPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lock-icon {
    font-size: 38px;
    color: var(--color-premium);
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px var(--color-premium-glow));
}

.lock-content h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.lock-content p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.5;
}

/* Pricing Tab Page Layout Styling */
.pricing-card-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pricing-body {
    padding: 15px 0;
    overflow-y: auto;
    flex-grow: 1;
}

.pricing-body .login-view,
.pricing-body .logged-in-view,
.pricing-body .premium-view {
    animation: fadeIn 0.4s ease;
}

.hourly-chart-card {
    grid-column: span 3;
}
.chart-filter-group select {
    cursor: pointer;
    transition: var(--transition-smooth);
}
.chart-filter-group select:hover {
    border-color: var(--border-glass-focus);
    background: rgba(255, 255, 255, 0.08);
}

/* Auth Tab Switcher Style */
.auth-tabs {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.auth-tab {
    transition: var(--transition-smooth);
    border-radius: var(--radius-sm);
}
.auth-tab:hover {
    color: var(--text-main) !important;
    background: rgba(255, 255, 255, 0.05);
}
.auth-tab.active {
    background: rgba(92, 98, 249, 0.1) !important;
}

/* AI Loading Mask */
.ai-loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-loading-mask.show {
    opacity: 1;
    pointer-events: auto;
}

.ai-loading-box {
    background: rgba(20, 22, 33, 0.65);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ai-loading-icon {
    font-size: 52px;
    color: #d946ef;
    text-shadow: 0 0 25px rgba(217, 70, 239, 0.6);
    margin-bottom: 25px;
}

.ai-loading-box h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.ai-loading-box p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 5px;
}

.ai-loading-box .ai-loading-sub {
    font-size: 11px;
    color: #a78bfa;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 25px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #5c62f9, #d946ef);
    animation: loadingProgress 3.5s infinite linear;
    transform-origin: left;
}

@keyframes loadingProgress {
    0% { transform: scaleX(0); }
    50% { transform: scaleX(0.7); }
    100% { transform: scaleX(1); }
}

