/* ========== CHIRI AI - CYBERPUNK PREMIUM EDITION ========== */
/* Professional Gaming UI with Advanced Animations */

:root {
    --primary-cyan: #00d4ff;
    --primary-magenta: #ff00ff;
    --primary-gold: #ffaa00;
    --primary-green: #00ff88;
    --primary-red: #ff4444;
    --bg-dark: #0a0a1a;
    --bg-darker: #050510;
    --glass-bg: rgba(0, 20, 40, 0.7);
    --glass-border: rgba(0, 212, 255, 0.3);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    font-family: 'Orbitron', 'Courier New', monospace;
    background: radial-gradient(ellipse at 30% 40%, #0a0a2a 0%, #000000 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--primary-cyan);
}

/* ========== ANIMATED BACKGROUND ========== */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(125deg, #0a0a2a 0%, #1a1a3a 50%, #0a0a2a 100%);
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ========== GLOW EFFECTS ========== */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3), 0 0 40px rgba(0, 212, 255, 0.1); }
    50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.6), 0 0 80px rgba(0, 212, 255, 0.2); }
}

@keyframes borderGlow {
    0%, 100% { border-color: var(--primary-cyan); }
    50% { border-color: var(--primary-magenta); }
}

/* ========== LOGIN SCREEN ========== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    z-index: 1000;
}

.login-container {
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95), rgba(0, 0, 0, 0.95));
    border: 2px solid var(--primary-cyan);
    border-radius: 40px;
    padding: 50px 60px;
    text-align: center;
    animation: glowPulse 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 212, 255, 0.1) 50%, transparent 70%);
    animation: shine 3s infinite;
}

@keyframes shine {
    from { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    to { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.login-robot-glow {
    font-size: 100px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--primary-cyan));
}

.gaming-title {
    font-size: 42px;
    letter-spacing: 6px;
    text-shadow: 0 0 15px var(--primary-cyan);
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-magenta));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gaming-subtitle {
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--primary-gold);
    margin-bottom: 15px;
}

.version-tag {
    font-size: 10px;
    color: #666;
    margin-bottom: 35px;
    letter-spacing: 2px;
}

.login-form {
    width: 320px;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    z-index: 1;
}

.input-group input {
    width: 100%;
    padding: 14px 18px 14px 50px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--primary-cyan);
    font-family: monospace;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    background: rgba(0, 0, 0, 0.8);
}

.gaming-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, var(--primary-cyan), #0066aa);
    border: none;
    border-radius: 50px;
    color: #000;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.gaming-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    letter-spacing: 3px;
}

/* ========== MODE SCREEN ========== */
.mode-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    padding: 20px;
}

.mode-container {
    max-width: 1300px;
    margin: 0 auto;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    margin-bottom: 40px;
    border: 1px solid var(--glass-border);
    animation: borderGlow 4s ease-in-out infinite;
    flex-wrap: wrap;
    gap: 15px;
}

.user-name {
    font-size: 22px;
    font-weight: bold;
    text-shadow: 0 0 10px var(--primary-cyan);
    letter-spacing: 2px;
}

/* ========== VOICE MODE SELECT (NÂNG CẤP) ========== */
.voice-mode-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 40px;
    border: 1px solid var(--primary-cyan);
}

.voice-mode-group label {
    font-size: 12px;
    color: #aaa;
}

#voiceModeSelect {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--primary-cyan);
    border-radius: 30px;
    padding: 8px 15px;
    color: var(--primary-cyan);
    font-family: monospace;
    cursor: pointer;
}

#voiceModeSelect option {
    background: #0a0a2a;
}

/* ========== TOGGLE SWITCH ========== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-cyan);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.logout-gaming {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 8px 25px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-gaming:hover {
    background: rgba(255, 0, 0, 0.5);
    color: white;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

/* ========== ROBOT STATUS ========== */
.robot-status {
    text-align: center;
    margin-bottom: 50px;
}

.robot-icon {
    font-size: 100px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--primary-cyan));
}

.status-badge {
    width: 16px;
    height: 16px;
    background: #666;
    border-radius: 50%;
    display: inline-block;
    margin: 15px auto;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.status-text {
    font-size: 14px;
    letter-spacing: 3px;
    color: #aaa;
}

/* ========== MODE CARDS ========== */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.mode-card {
    background: linear-gradient(135deg, rgba(0, 30, 60, 0.9), rgba(0, 0, 0, 0.9));
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.mode-card:hover::before {
    left: 100%;
}

.mode-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.2);
    border-color: var(--primary-cyan);
}

.mode-icon {
    font-size: 60px;
    margin-bottom: 20px;
    transition: transform 0.3s;
}

.mode-card:hover .mode-icon {
    transform: scale(1.1);
}

.mode-name {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mode-desc {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 15px;
}

.mode-badge {
    display: inline-block;
    background: rgba(0, 212, 255, 0.15);
    border-radius: 30px;
    padding: 5px 15px;
    font-size: 11px;
    color: var(--primary-cyan);
    letter-spacing: 1px;
}

/* ========== MODE PANELS (CHUNG) ========== */
.mode-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    overflow-y: auto;
    z-index: 100;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid var(--primary-cyan);
    flex-wrap: wrap;
    gap: 10px;
}

.back-btn, .home-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover, .home-btn:hover {
    background: var(--primary-cyan);
    color: #000;
}

.panel-title {
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 5px var(--primary-cyan);
}

.panel-status {
    font-size: 12px;
    color: var(--primary-gold);
}

/* ========== GAME TYPE SELECTION ========== */
.game-type-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
    padding: 60px 20px;
    min-height: 70vh;
}

.game-type-card {
    width: 320px;
    background: linear-gradient(135deg, rgba(0, 40, 60, 0.95), rgba(0, 0, 0, 0.95));
    border-radius: 30px;
    padding: 40px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.game-type-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-magenta));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.game-type-card:hover::after {
    transform: scaleX(1);
}

.game-type-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--primary-cyan);
    box-shadow: 0 25px 50px rgba(0, 212, 255, 0.3);
}

.game-type-icon {
    font-size: 100px;
    margin-bottom: 25px;
    animation: float 3s ease-in-out infinite;
}

.game-type-name {
    font-size: 32px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-cyan), #00ff88);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.game-type-desc {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 25px;
}

.game-type-badge {
    display: inline-block;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid var(--primary-cyan);
    border-radius: 40px;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: bold;
    color: var(--primary-cyan);
    letter-spacing: 1px;
}

/* ========== GAME PANEL ========== */
.game-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 80px);
    background: linear-gradient(180deg, #0a0a2a 0%, #1a1a3a 100%);
    overflow: hidden;
    border-radius: 20px;
    margin-top: 10px;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#webcam {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 180px;
    height: 135px;
    border-radius: 15px;
    border: 3px solid var(--primary-cyan);
    z-index: 10;
    background: #000;
    object-fit: cover;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    transition: all 0.3s;
}

#webcam:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
}

#gameHud {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px 25px;
    border-left: 4px solid var(--primary-cyan);
    font-family: 'Orbitron', monospace;
}

#gameHud div {
    margin: 5px 0;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

#gameSpeed { color: var(--primary-green); }
#gameScore { color: var(--primary-gold); }
#gameLives { color: #ff4444; }
#gameStatus { 
    color: var(--primary-cyan);
    font-size: 18px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.game-instruction {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 12px 20px;
    text-align: center;
    font-size: 12px;
    color: #aaa;
    border: 1px solid var(--glass-border);
    pointer-events: none;
}

.game-instruction span {
    color: var(--primary-cyan);
    font-weight: bold;
}

/* ========== DRIVE MODE ========== */
.drive-container {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.drive-robot {
    text-align: center;
}

.robot-icon-large {
    font-size: 80px;
    filter: drop-shadow(0 0 20px var(--primary-cyan));
    animation: float 3s ease-in-out infinite;
}

.drive-status {
    margin-top: 15px;
    font-size: 14px;
    color: var(--primary-green);
    letter-spacing: 2px;
}

.drive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 400px;
    margin: 0 auto;
}

.drive-btn-gaming {
    background: rgba(0, 212, 255, 0.15);
    border: 2px solid var(--primary-cyan);
    border-radius: 20px;
    padding: 20px;
    font-size: 36px;
    cursor: pointer;
    transition: all 0.1s;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.drive-btn-gaming:active {
    transform: scale(0.95);
    background: var(--primary-cyan);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.drive-btn-gaming span {
    display: block;
    font-size: 12px;
    margin-top: 5px;
    color: #aaa;
}

.drive-btn-gaming.up span { color: #00ff88; }
.drive-btn-gaming.down span { color: #ff4444; }
.drive-btn-gaming.left span { color: #ffaa00; }
.drive-btn-gaming.right span { color: #ffaa00; }
.drive-btn-gaming.stop {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff4444;
}
.drive-btn-gaming.stop span { color: #ff4444; }

.drive-voice-hint {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    margin-top: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 30px;
}

/* ========== TRANSLATE MODE ========== */
.translate-container {
    padding: 20px;
}

.lang-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.lang-select-gaming {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--primary-cyan);
    border-radius: 30px;
    padding: 10px 20px;
    color: var(--primary-cyan);
    font-family: monospace;
    cursor: pointer;
}

.swap-gaming {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid var(--primary-cyan);
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
}

.swap-gaming:hover {
    background: var(--primary-cyan);
    color: #000;
}

.translation-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.original-box, .translated-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-cyan);
    border-radius: 20px;
    padding: 20px;
    min-height: 250px;
}

.box-header-gaming {
    color: var(--primary-gold);
    margin-bottom: 15px;
    font-size: 14px;
    letter-spacing: 2px;
}

.original-text, .translated-text {
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    color: #fff;
}

.translate-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
}

.control-gaming {
    padding: 10px 25px;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid var(--primary-cyan);
    border-radius: 30px;
    color: var(--primary-cyan);
    cursor: pointer;
    transition: all 0.3s;
}

.control-gaming:hover {
    background: var(--primary-cyan);
    color: #000;
}

/* ========== CAMERA MODE ========== */
.camera-container-gaming {
    padding: 20px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid var(--primary-cyan);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

#video {
    width: 100%;
    border-radius: 20px;
    transform: scaleX(-1);
    background: #000;
}

#canvas {
    display: none;
}

.face-info {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.face-emoji {
    font-size: 60px;
    animation: pulse 2s infinite;
}

.face-text {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
    color: var(--primary-cyan);
}

.face-details-gaming {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.face-details-gaming span {
    padding: 5px 12px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.camera-buttons-gaming {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.cam-gaming {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-cyan), #0088aa);
    border: none;
    border-radius: 30px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.cam-gaming:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.cam-gaming.register {
    background: linear-gradient(135deg, #ffaa00, #cc8800);
    color: #000;
}

.cam-gaming.recognize {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    color: #000;
}

/* ========== MODAL REGISTER ========== */
.modal-gaming {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content-gaming {
    background: linear-gradient(135deg, #0a0a2a, #000);
    border: 2px solid var(--primary-cyan);
    border-radius: 30px;
    max-width: 550px;
    width: 90%;
    animation: glowPulse 2s infinite;
}

.modal-header-gaming {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.modal-header-gaming h3 {
    color: var(--primary-cyan);
    letter-spacing: 2px;
}

.close-modal-gaming {
    background: none;
    border: none;
    color: #ff4444;
    font-size: 32px;
    cursor: pointer;
}

.modal-body-gaming {
    padding: 25px;
}

.preview-area {
    text-align: center;
    margin-bottom: 20px;
}

#previewCanvas {
    width: 100%;
    max-width: 320px;
    border-radius: 15px;
    border: 1px solid var(--primary-cyan);
}

.preview-status {
    margin-top: 10px;
    font-size: 12px;
    color: #aaa;
}

.register-form-gaming {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#faceNameInput {
    padding: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--primary-cyan);
    border-radius: 30px;
    color: var(--primary-cyan);
    text-align: center;
}

.photo-counter {
    text-align: center;
    font-size: 14px;
    color: #ffaa00;
}

.register-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-gaming {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-cyan), #0088aa);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
}

.action-gaming.save {
    background: linear-gradient(135deg, #00ff88, #00cc66);
}

/* ========== CHAT MODE ========== */
.chat-container {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.chat-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
}

.message.user {
    justify-content: flex-end;
}

.message.ai {
    justify-content: flex-start;
}

.bubble {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 20px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary-cyan);
    word-wrap: break-word;
}

.message.user .bubble {
    background: linear-gradient(135deg, var(--primary-cyan), #0088aa);
    color: #000;
}

/* ========== BUTTONS ========== */
.chat-controls, .chat-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
}

.control-btn {
    padding: 10px 25px;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid var(--primary-cyan);
    border-radius: 40px;
    color: var(--primary-cyan);
    cursor: pointer;
    transition: all 0.3s;
}

.control-btn:hover {
    background: var(--primary-cyan);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* ========== SLEEP TIMER ========== */
.sleep-timer {
    text-align: center;
    font-size: 12px;
    color: var(--primary-gold);
    margin-top: 15px;
    letter-spacing: 1px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .mode-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .game-type-container {
        gap: 25px;
        padding: 30px 15px;
    }
    
    .game-type-card {
        width: 280px;
        padding: 30px 20px;
    }
    
    .game-type-icon {
        font-size: 70px;
    }
    
    .game-type-name {
        font-size: 24px;
    }
    
    .login-container {
        padding: 30px 25px;
        margin: 20px;
    }
    
    .login-form {
        width: 260px;
    }
    
    .gaming-title {
        font-size: 28px;
    }
    
    .user-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .voice-mode-group {
        justify-content: center;
    }
    
    #webcam {
        width: 120px;
        height: 90px;
        bottom: 10px;
        right: 10px;
    }
    
    #gameHud {
        padding: 8px 15px;
    }
    
    #gameHud div {
        font-size: 12px;
    }
    
    .game-instruction {
        font-size: 9px;
        bottom: 10px;
    }
    
    .drive-grid {
        gap: 10px;
    }
    
    .drive-btn-gaming {
        padding: 15px;
        font-size: 24px;
    }
    
    .translation-box {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .mode-card {
        padding: 20px 15px;
    }
    
    .mode-icon {
        font-size: 40px;
    }
    
    .mode-name {
        font-size: 18px;
    }
    
    .game-type-card {
        width: 260px;
    }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-magenta));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-magenta), var(--primary-cyan));
}

/* ========== ANIMATIONS ========== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

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

.mode-card, .game-type-card {
    animation: slideIn 0.5s ease-out forwards;
}

.mode-card:nth-child(1) { animation-delay: 0.1s; }
.mode-card:nth-child(2) { animation-delay: 0.2s; }
.mode-card:nth-child(3) { animation-delay: 0.3s; }
.mode-card:nth-child(4) { animation-delay: 0.4s; }
.mode-card:nth-child(5) { animation-delay: 0.5s; }
.mode-card:nth-child(6) { animation-delay: 0.6s; }


/* ========== KNOWLEDGE MANAGEMENT STYLES ========== */
.upload-section, .file-list-section, .web-crawler-section, .domain-config-section {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #00d4ff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.upload-section h3, .file-list-section h3, .web-crawler-section h3, .domain-config-section h3 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.file-input-area, .url-input-area, .domain-input-area {
    display: flex;
    gap: 10px;
}

.file-input-area input, .url-input-area input, .domain-input-area input {
    flex: 1;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00d4ff;
    border-radius: 10px;
    padding: 12px;
    color: #fff;
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.file-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    color: #fff;
}

.file-size {
    color: #888;
    font-size: 0.8rem;
}

.delete-btn {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid #ff4444;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-btn:hover {
    background: rgba(255, 0, 0, 0.5);
}

.success-message {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid #00ff00;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    color: #00ff00;
}

.error-message {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid #ff4444;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    color: #ff4444;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    display: block;
    width: 50%;
    height: 100%;
    background: #00d4ff;
    animation: progress 1s infinite;
}

@keyframes progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}
