* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;

    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;

    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #1f2937;

    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
    min-height: 100vh;
    overflow-x: hidden;
    padding: 10px;
}

/* Viewport Container for Two-Column Layout */
.viewport-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 1920px;
    margin: 0 auto;
    min-height: 100vh;
    max-height: 100vh;
    align-items: center;
    padding: 10px;
}

/* Desktop: Two columns side by side */
@media (min-width: 1024px) {
    .viewport-container {
        grid-template-columns: auto 1fr;
        max-width: 1400px;
        padding: 20px;
        align-items: center;
    }
}

/* Large Desktop: Optimized spacing */
@media (min-width: 1440px) {
    .viewport-container {
        grid-template-columns: 420px 1fr;
        gap: 40px;
        max-width: 1600px;
    }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.5); }
    50% { box-shadow: 0 0 40px rgba(236, 72, 153, 0.8); }
}

@keyframes bounce-in {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Container & Layout */
.container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Phone Frame */
.phone-container {
    display: flex;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 40px);
}

.phone-frame {
    width: min(375px, 100vw - 20px);
    height: 100%;
    max-height: calc(100vh - 40px);
    background: linear-gradient(145deg, #1f2937, #111827);
    border-radius: 40px;
    padding: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 3px #374151;
    position: relative;
    display: flex;
    flex-direction: column;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Screen Content Wrapper */
.screen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-secondary);
}

/* Ensure content-area also follows same rules */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-secondary);
    padding: 20px;
}

.volume-buttons {
    position: absolute;
    left: -4px;
    top: 130px;
}

.volume-btn {
    width: 4px;
    height: 48px;
    background: linear-gradient(to bottom, #4b5563, #374151);
    border-radius: 4px 0 0 4px;
    margin-bottom: 8px;
}

.power-button {
    position: absolute;
    right: -4px;
    top: 160px;
    width: 4px;
    height: 64px;
    background: linear-gradient(to bottom, #4b5563, #374151);
    border-radius: 0 4px 4px 0;
}

/* Dynamic Island */
.dynamic-island {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 144px;
    height: 32px;
    background: #000;
    border-radius: 0 0 32px 32px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.island-indicator {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.island-speaker {
    width: 56px;
    height: 12px;
    background: #1f2937;
    border-radius: 12px;
}

/* Status Bar */
.status-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 40;
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.signal-bar {
    width: 3px;
    background: var(--text-primary);
    border-radius: 2px;
}

.signal-bar:nth-child(1) { height: 4px; }
.signal-bar:nth-child(2) { height: 7px; }
.signal-bar:nth-child(3) { height: 10px; }
.signal-bar:nth-child(4) { height: 13px; }

.signal-bar.weak {
    background: var(--text-light);
}

.battery {
    width: 24px;
    height: 12px;
    border: 2px solid var(--text-primary);
    border-radius: 3px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 2px;
}

.battery::after {
    content: '';
    width: 2px;
    height: 6px;
    background: var(--text-primary);
    position: absolute;
    right: -4px;
    border-radius: 0 2px 2px 0;
}

.battery-fill {
    width: 100%;
    height: 100%;
    background: var(--success-color);
    border-radius: 1px;
}

/* App Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    position: relative;
    z-index: 30;
}

.menu-btn, .notif-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.menu-btn:hover, .notif-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.screen-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    flex: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notif-btn {
    position: relative;
}

.notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger-color);
    border-radius: 50%;
    border: 2px solid white;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-secondary);
    padding: 20px;
}

.content-area::-webkit-scrollbar {
    width: 4px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* Page Title */
.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

/* Input Fields */
.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group {
    margin-bottom: 16px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Bottom Navigation */
.bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e5e7eb;
    padding: 6px;
    display: flex;
    justify-content: space-around;
    flex-shrink: 0;
    position: relative;
    z-index: 30;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.2s;
    flex: 1;
    max-width: 80px;
}

.nav-btn.active {
    background: linear-gradient(to bottom right, #3b82f6, #9333ea);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.nav-btn:hover {
    transform: scale(1.05);
}

.nav-icon {
    width: 24px;
    height: 24px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
}

/* Back Button */
.back-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.back-btn:hover {
    background: white;
    transform: scale(1.05);
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: white;
    box-shadow: var(--shadow-xl);
    z-index: 100;
    transition: left 0.3s ease;
}

.side-menu.active {
    left: 0;
}

.side-menu-content {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.menu-title {
    font-size: 20px;
    font-weight: 700;
}

.close-menu-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-menu-btn:hover {
    background: var(--border-color);
    transform: rotate(90deg);
}

.menu-items {
    list-style: none;
}

.menu-item {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.menu-item:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.menu-item-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.menu-item-label {
    font-weight: 600;
    font-size: 16px;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    display: none;
    backdrop-filter: blur(2px);
}

.overlay.active {
    display: block;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert Box */
.alert {
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ==================== EXPLANATION PANEL SYSTEM ==================== */

/* Explanation Panel Container */
.explanation-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    max-height: calc(100vh - 40px);
    animation: slide-in-right 0.6s ease-out;
}

/* Mobile: Stack vertically */
@media (max-width: 1023px) {
    .explanation-panel {
        display: none; /* Hidden on mobile by default */
    }

    .explanation-panel.mobile-visible {
        display: block;
        margin-top: 20px;
        max-height: 500px;
    }
}

/* Tablet: Smaller padding */
@media (min-width: 768px) and (max-width: 1023px) {
    .explanation-panel {
        padding: 24px;
    }
}

/* Desktop: Full features */
@media (min-width: 1024px) {
    .explanation-panel {
        max-height: calc(100vh - 60px);
        position: sticky;
        top: 30px;
    }
}

/* Panel Scrollbar Styling */
.explanation-panel::-webkit-scrollbar {
    width: 6px;
}

.explanation-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.explanation-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

/* Panel Header */
.panel-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.panel-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.panel-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
}

.panel-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Panel Sections */
.panel-section {
    margin-bottom: 32px;
    animation: fade-in 0.5s ease-out;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-icon {
    width: 40px;
    height: 40px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-color);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-content {
    padding-left: 52px;
}

/* Feature List */
.feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(4px);
}

.feature-icon {
    width: 24px;
    height: 24px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.feature-text {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
}

.feature-text strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Steps List */
.steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: step-counter;
}

.step-item {
    position: relative;
    padding-left: 52px;
    margin-bottom: 24px;
    counter-increment: step-counter;
}

.step-item::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.step-item::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 40px;
    width: 2px;
    height: calc(100% - 32px);
    background: linear-gradient(to bottom, var(--primary-color), transparent);
}

.step-item:last-child::after {
    display: none;
}

.step-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Benefit Cards */
.benefit-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
}

@media (min-width: 1200px) {
    .benefit-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.benefit-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.benefit-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

.benefit-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.benefit-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.benefit-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Use Case Cards */
.usecase-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.usecase-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.usecase-scenario {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 8px;
}

/* Safety Badge */
.safety-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success-color);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 16px;
}

.safety-badge-icon {
    font-size: 18px;
}

/* Info Box */
.info-box {
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid var(--info-color);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
}

.info-box-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--info-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Toggle Button (Mobile) */
.toggle-panel-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
    z-index: 80;
    transition: all 0.3s ease;
    display: none;
}

@media (max-width: 1023px) {
    .toggle-panel-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.toggle-panel-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.5);
}

.toggle-panel-btn:active {
    transform: scale(0.95);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    display: block;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Highlight Text */
.highlight-text {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Panel Footer */
.panel-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

.panel-footer-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.panel-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.panel-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.panel-cta-btn:active {
    transform: translateY(0);
}


/* ==================== AI CHATBOT STYLES ==================== */

/* AI Mode Tabs */
.ai-mode-tabs {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 15px;
}

.ai-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px;
    background: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-tab:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ai-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
}

.ai-tab span:first-child {
    font-size: 24px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 10px;
    animation: slide-up 0.3s ease;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-message .message-content {
    align-items: flex-end;
}

.message-text {
    padding: 12px 15px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

.user-message .message-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.message-time {
    font-size: 11px;
    color: var(--text-light);
    padding: 0 5px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
    animation: typing-dot 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-dot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.chat-action-btn,
.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-action-btn {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.chat-action-btn:hover,
.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: var(--primary-color);
}

/* Quick Options */
.quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 15px 15px;
}

.quick-option-btn {
    padding: 8px 15px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-option-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* Voice Interface */
.voice-interface {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.voice-status {
    text-align: center;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
}

.voice-animation {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    height: 60px;
    margin-bottom: 20px;
}

.voice-wave {
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    animation: voice-wave 1.2s ease-in-out infinite;
}

.voice-animation.active .voice-wave {
    animation: voice-wave 1.2s ease-in-out infinite;
}

.voice-animation .voice-wave:nth-child(1) { animation-delay: 0s; }
.voice-animation .voice-wave:nth-child(2) { animation-delay: 0.1s; }
.voice-animation .voice-wave:nth-child(3) { animation-delay: 0.2s; }
.voice-animation .voice-wave:nth-child(4) { animation-delay: 0.3s; }
.voice-animation .voice-wave:nth-child(5) { animation-delay: 0.4s; }

@keyframes voice-wave {
    0%, 100% { height: 20px; }
    50% { height: 60px; }
}

.voice-status h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.voice-status p {
    font-size: 14px;
    color: var(--text-secondary);
}

.voice-transcript,
.voice-response {
    width: 100%;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.transcript-label,
.response-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.transcript-text,
.response-text {
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 50px;
}

.voice-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.voice-control-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.voice-control-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.voice-control-btn.active {
    animation: pulse-glow 2s infinite;
}

.voice-settings {
    width: 100%;
}

.voice-language-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 14px;
    background: var(--bg-primary);
    cursor: pointer;
}

/* Vision Interface */
.vision-interface {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.camera-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-canvas {
    display: none;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 20px;
}

.camera-guide {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.vision-result {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-lg);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.result-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-close-btn:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-image img {
    width: 100%;
    border-radius: var(--radius-md);
}

.result-description h4,
.result-safety h4,
.result-recommendations h4 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.result-description p,
.result-safety p,
.result-recommendations p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.result-recommendations ul {
    list-style: none;
    padding: 0;
}

.result-recommendations li {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.safety-score-bar {
    position: relative;
    width: 100%;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 10px 0;
}

.safety-score-fill {
    height: 100%;
    transition: width 1s ease;
}

.safety-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.vision-controls {
    display: flex;
    gap: 10px;
    padding: 15px;
}

.vision-control-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vision-control-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    flex: 0 0 auto;
    min-width: 80px;
}

.vision-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* AI Info Card */
.ai-info-card {
    margin: 20px 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.info-header span {
    font-size: 24px;
}

.info-header h4 {
    font-size: 16px;
    color: var(--text-primary);
}

.info-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.info-list li {
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-primary);
}

.info-note {
    font-size: 12px;
    font-style: italic;
    color: var(--text-light);
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
