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

:root {
    --primary-cyan: #00e5ff;
    --cyan-text: #00bcd4;
    --cyan-dim: #006064;
    --pure-black: #000000;
    --card-black: #0a0a0a;
    --border-dark: #1a1a1a;
    --text-primary: #00e5ff;
    --text-secondary: #607d8b;
    --success: #00e676;
    --danger: #ff1744;
    --warning: #ffc107;
    --table-header: #050505;
    --table-row-hover: rgba(0, 229, 255, 0.05);
}

body {
    font-family: 'Orbitron', 'Noto Sans KR', monospace;
    background: var(--pure-black);
    color: var(--cyan-text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Login Panel */
.panel {
    display: none;
    min-height: 100vh;
    background: var(--pure-black);
}

.panel.active {
    display: block;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.logo-section {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-glow {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-cyan);
    border: 2px solid var(--cyan-dim);
    border-radius: 10px;
    background: var(--card-black);
}

.title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-cyan);
    margin-bottom: 0.5rem;
    letter-spacing: 3px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Form Styles */
.cyber-form {
    width: 100%;
    max-width: 400px;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--card-black);
    border: 1px solid var(--cyan-dim);
    border-radius: 5px;
    color: var(--cyan-text);
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-cyan);
}

.input-group input::placeholder {
    color: var(--text-secondary);
}

/* Button Styles */
.cyber-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--card-black);
    border: 2px solid var(--primary-cyan);
    border-radius: 5px;
    color: var(--primary-cyan);
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
}

.cyber-btn:hover {
    background: var(--primary-cyan);
    color: var(--pure-black);
}

/* Language Switch */
.lang-switch {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    background: var(--card-black);
    border: 1px solid var(--cyan-dim);
    border-radius: 3px;
    color: var(--text-secondary);
    font-family: 'Orbitron', monospace;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn.active,
.lang-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--card-black);
    border-bottom: 1px solid var(--border-dark);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-cyan);
}

.brand-logo {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-cyan);
    color: var(--primary-cyan);
    border-radius: 5px;
    font-weight: 900;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-item {
    padding: 0.6rem 1.2rem;
    background: var(--pure-black);
    border: 1px solid var(--cyan-dim);
    border-radius: 3px;
    color: var(--text-secondary);
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switch-mini {
    display: flex;
    gap: 0.25rem;
}

.lang-btn-mini {
    padding: 0.4rem 0.8rem;
    background: var(--pure-black);
    border: 1px solid var(--cyan-dim);
    border-radius: 3px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn-mini:hover,
.lang-btn-mini.active {
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: var(--pure-black);
    border: 1px solid var(--danger);
    border-radius: 3px;
    color: var(--danger);
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--danger);
    color: var(--pure-black);
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
    background: var(--pure-black);
    min-height: calc(100vh - 60px);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}
.search-toggle-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.search-toggle-btn:hover {
    background: rgba(0, 230, 118, 0.2);
    border-color: #00e676;
}
.search-input-expandable:focus {
    outline: none;
    border-color: #00e676;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.2);
}


.search-toggle-btn .search-icon {
    font-size: 1.2rem;
}

/* Expandable Search Input */
.search-input-expandable {
    width: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.4s ease;
    overflow: hidden;
}
.search-input-expandable::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.search-input-expandable.active {
    width: 300px;
    padding: 10px 15px;
    opacity: 1;
}


.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-cyan);
    letter-spacing: 1px;
}
.header-right-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.status-indicators {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s;
    user-select: none;
}
.indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.2);
}

.indicator.active {
    border-color: #00e676;
    background: rgba(0, 230, 118, 0.15);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.3);
}


.indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.indicator.online .dot {
    background: #00e676;
}

.indicator.offline .dot {
    background: #ff1744;
}

.indicator.all .dot {
    background: #00bfff;
}

/* Table View with Horizontal Scroll */
.devices-table-container {
    background: var(--card-black);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.1);
    -webkit-overflow-scrolling: touch;
}

.devices-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.devices-table thead {
    background: var(--table-header);
    border-bottom: 2px solid var(--cyan-dim);
}

.devices-table th {
    padding: 1rem;
    text-align: left;
    color: var(--primary-cyan);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--table-header);
    z-index: 10;
}

.android-id {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
}

.devices-table tbody tr {
    cursor: pointer;
    transition: all 0.2s;
}

.devices-table tbody tr:hover {
    background: hsla(182, 71%, 32%, 0.05);
}
.devices-table tbody tr.selected {
    background: rgba(18, 128, 156, 0.576);
    border-left: 3px solid #108296;
}
.devices-table tbody tr.selected td:first-child {
    padding-left: 13px; /* Adjust for border */
}
.devices-table td {
    padding: 1rem;
    color: var(--cyan-text);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Profile column */
.device-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.device-avatar {
    width: 40px;
    height: 40px;
    background: var(--pure-black);
    border: 2px solid var(--cyan-dim);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary-cyan);
}

/* Client Name */
.client-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.client-name .flag {
    font-size: 1.2rem;
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.status-badge.online {
    background: rgba(0, 230, 118, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-badge.offline {
    background: rgba(255, 23, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Battery indicator */
.battery-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 400;
    color: #c2cdd2;
    transition: color 0.3s;
}

.battery-indicator.low {
    color: rgb(219, 224, 230);
}

.battery-indicator.charging {
    color: #eef2f3;
}

.country-flag, .flag {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif !important;
    font-size: 1.2em;
    line-height: 1;
}
/* Force emoji font for flags */
.country-flag, .flag {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif !important;
    font-size: 1.2em;
    line-height: 1;
}

/* Fallback for unsupported flags */
.country-code {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(0, 230, 118, 0.2);
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    color: #00e676;
}

/* Select checkbox */
.select-device {
    width: 20px;
    height: 20px;
    border: 2px solid var(--cyan-dim);
    border-radius: 4px;
    background: var(--pure-black);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.select-device:hover {
    border-color: var(--primary-cyan);
}

.select-device.selected {
    background: var(--primary-cyan);
    border-color: var(--primary-cyan);
}

.select-device.selected::after {
    content: '✓';
    color: var(--pure-black);
    font-weight: bold;
    font-size: 14px;
}

/* Table actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    padding: 0.4rem 0.8rem;
    background: var(--pure-black);
    border: 1px solid var(--cyan-dim);
    border-radius: 4px;
    color: var(--cyan-text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
}

.action-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.action-btn.view-btn {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.action-btn.view-btn:hover {
    background: var(--primary-cyan);
    color: var(--pure-black);
}

/* Empty state */
.empty-table-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

/* Modal styles (keep existing) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-black);
    border: 1px solid var(--cyan-dim);
    border-radius: 5px;
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--pure-black);
    border-bottom: 1px solid var(--border-dark);
}

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--primary-cyan);
    letter-spacing: 1px;
}

.modal-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.98), rgba(30, 30, 30, 0.98));
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-radius: 8px;
    padding: 8px;
    min-width: 200px;
    z-index: 10000;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 230, 118, 0.2);
    backdrop-filter: blur(10px);
}

.context-menu.active {
    display: block;
}

.context-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.context-menu-item span {
    font-size: 1.2rem;
}

.context-menu-item:hover {
    background: rgba(0, 230, 118, 0.15);
    transform: translateX(4px);
}
.refresh-all-btn {
    padding: 0.5rem 1rem;
    background: var(--pure-black);
    border: 1px solid var(--primary-cyan);
    border-radius: 3px;
    color: var(--primary-cyan);
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.refresh-all-btn:hover {
    background: var(--primary-cyan);
    color: var(--pure-black);
}

.delete-device-btn {
    padding: 0.5rem 1rem;
    background: var(--pure-black);
    border: 1px solid var(--danger);
    border-radius: 3px;
    color: var(--danger);
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-device-btn:hover {
    background: var(--danger);
    color: var(--pure-black);
}

.close-btn {
    width: 35px;
    height: 35px;
    background: var(--pure-black);
    border: 1px solid var(--text-secondary);
    border-radius: 3px;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.modal-tabs {
    display: flex;
    background: var(--pure-black);
    border-bottom: 1px solid var(--border-dark);
}

.tab-btn {
    flex: 1;
    padding: 0.8rem;
    background: var(--pure-black);
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary-cyan);
    border-bottom-color: var(--primary-cyan);
    background: var(--card-black);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    background: var(--pure-black);
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}
/* ========================================
   AI BOT MANAGER - FLOATING BOTTOM RIGHT - FIXED
   ======================================== */

/* Floating Bot Button - Bottom Right Corner */
.bot-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(0, 230, 255, 0.2), rgba(0, 191, 165, 0.2));
    border: 2px solid var(--primary-cyan);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001; /* Above chat box */
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 230, 255, 0.4);
}

.bot-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 230, 255, 0.6);
    background: linear-gradient(135deg, rgba(0, 230, 255, 0.3), rgba(0, 191, 165, 0.3));
}

.bot-floating-btn.active {
    background: linear-gradient(135deg, rgba(0, 230, 255, 0.4), rgba(0, 191, 165, 0.4));
    box-shadow: 0 0 30px rgba(0, 230, 255, 0.8);
    transform: scale(0.9); /* Shrink when open */
}

.bot-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-emoji {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.8));
}

.bot-status-indicator {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background: #00e676;
    border: 2px solid var(--pure-black);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Bot Chat Box - Responsive & Non-Overlapping */
.bot-chat-box {
    position: fixed;
    bottom: 120px; /* Above the floating button with gap */
    right: 30px;
    width: 450px;
    max-width: calc(100vw - 60px); /* Responsive to viewport */
    height: 0;
    max-height: calc(100vh - 200px); /* Never exceed viewport height */
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid var(--primary-cyan);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    z-index: 1000; /* Below button */
    box-shadow: 0 10px 40px rgba(0, 230, 255, 0.4);
    backdrop-filter: blur(10px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none; /* Ignore clicks when closed */
}

.bot-chat-box.active {
    height: 550px;
    max-height: calc(100vh - 200px); /* Responsive */
    opacity: 1;
    transform: translateY(0);
    pointer-events: all; /* Enable clicks when open */
}

.bot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(0, 230, 255, 0.1), rgba(0, 191, 165, 0.1));
    border-bottom: 1px solid var(--primary-cyan);
    border-radius: 10px 10px 0 0;
    min-height: 70px;
    flex-shrink: 0; /* Don't shrink */
}

.bot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-emoji-large {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px rgba(0, 230, 255, 0.6));
}

.bot-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-cyan);
    letter-spacing: 1px;
}

.bot-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.bot-close-btn {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--cyan-dim);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.bot-close-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

/* Bot Messages - TERMINAL STYLE */
.bot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #000000;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    min-height: 0; /* Allow flex shrink */
}

.bot-messages::-webkit-scrollbar {
    width: 6px;
}

.bot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.bot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 230, 255, 0.3);
    border-radius: 3px;
}

.bot-welcome {
    text-align: center;
    padding: 30px 20px;
}

.bot-emoji-welcome {
    font-size: 4rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 15px rgba(0, 230, 255, 0.6));
}

.bot-welcome-text {
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.6;
    font-family: 'Courier New', monospace;
}

/* Bot Message Line - FULL TEXT VISIBLE */
.bot-message-line {
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 2px 0;
    word-wrap: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    display: block;
}

/* Bot Status Bar */
.bot-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid var(--cyan-dim);
    border-radius: 0 0 10px 10px;
    min-height: 50px;
    flex-shrink: 0; /* Don't shrink */
}

.bot-status-text {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.bot-status-dot {
    width: 10px;
    height: 10px;
    background: #00e676;
    border-radius: 50%;
}

.bot-status-dot.pulse {
    animation: pulse 2s infinite;
}

/* Responsive Breakpoints */

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
    .bot-chat-box {
        width: 400px;
        bottom: 110px;
    }
    
    .bot-chat-box.active {
        height: 500px;
        max-height: calc(100vh - 180px);
    }
}


/* Mobile Phones */
@media (max-width: 480px) {
    .bot-floating-btn {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }
    
    .bot-emoji {
        font-size: 1.8rem;
    }
    
    .bot-chat-box {
        width: calc(100vw - 30px);
        bottom: 85px;
        right: 15px;
        left: 15px;
    }
    
    .bot-chat-box.active {
        height: calc(100vh - 150px);
        max-height: calc(100vh - 150px);
    }
    
    .bot-header {
        padding: 12px 15px;
        min-height: 60px;
    }
    
    .bot-title {
        font-size: 0.9rem;
    }
    
    .bot-subtitle {
        font-size: 0.7rem;
    }
    
    .bot-emoji-large {
        font-size: 1.8rem;
    }
    
    .bot-messages {
        padding: 15px;
        gap: 3px;
    }
    
    .bot-message-line {
        font-size: 0.85rem;
    }
    
    .bot-status-bar {
        padding: 10px 15px;
        min-height: 45px;
    }
}

/* Very Small Screens */
@media (max-width: 360px) {
    .bot-floating-btn {
        width: 50px;
        height: 50px;
    }
    
    .bot-emoji {
        font-size: 1.5rem;
    }
    
    .bot-chat-box.active {
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
    }
}

/* Landscape Mode on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .bot-chat-box.active {
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }
    
    .bot-floating-btn {
        bottom: 10px;
        right: 10px;
    }
    
    .bot-chat-box {
        bottom: 70px;
    }
}

/* Star Icon Styles */
.star-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(0, 255, 255, 0.5));
}

.star-icon path {
    fill: none;
    stroke: #00ffff;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.star-icon.active path {
    fill: #00ffff;
    stroke: #00ffff;
    filter: drop-shadow(0 0 10px #00ffff);
}

.star-icon:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.8));
}

/* Star Navigation Button */
.star-nav-btn {
    padding: 10px 20px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    color: #00ffff;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.star-nav-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.star-nav-btn svg {
    width: 20px;
    height: 20px;
}

.star-nav-btn.active {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

/* Info Tab */
.info-grid {
    padding: 1.5rem;
    display: grid;
    gap: 1rem;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    background: var(--card-black);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-value {
    color: var(--cyan-text);
    font-weight: 600;
}

/* Contacts List */
.contacts-list {
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.8rem;
    background: var(--card-black);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    transition: all 0.3s;
}

.contact-item:hover {
    border-color: var(--cyan-dim);
}

.contact-avatar {
    width: 45px;
    height: 45px;
    background: var(--pure-black);
    border: 2px solid var(--primary-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-cyan);
    font-size: 1.2rem;
}

/* File Explorer - Improved Layout */
.file-explorer {
    display: flex;
    height: 100%;
    width: 100%;
}

.file-browser {
    flex: 1;
    min-width: 50%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-dark);
}

.file-path-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.path-btn,
.refresh-btn {
    padding: 0.5rem 0.8rem;
    background: var(--pure-black);
    border: 1px solid var(--cyan-dim);
    border-radius: 3px;
    color: var(--cyan-text);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
}

.path-btn:hover,
.refresh-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

#currentPath {
    flex: 1;
    padding: 0.5rem;
    background: var(--pure-black);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--cyan-text);
    font-family: monospace;
}



.file-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 14px;
    backdrop-filter: blur(10px);
}
.file-item:hover {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.08), rgba(0, 191, 255, 0.08));
    border-color: rgba(0, 230, 118, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 230, 118, 0.1);
}

.file-item.selected {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.12), rgba(0, 191, 255, 0.12));
    border-color: #00e676;
    box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.3), 0 4px 20px rgba(0, 230, 118, 0.15);
}

.file-item:active {
    transform: scale(0.99);
}

.file-icon {
    font-size: 2.2rem;
    min-width: 45px;
    text-align: center;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.file-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.file-meta {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.file-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.file-action-btn {
    padding: 8px 16px;
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.file-action-btn:hover {
    background: rgba(0, 230, 118, 0.25);
    border-color: #00e676;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 230, 118, 0.2);
}

.file-action-btn:active {
    transform: translateY(0);
}

.file-action-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}
/* File manager header */
.file-path-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.file-path-container input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

.file-path-container button {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.file-path-container button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00e676;
}

/* Scrollbar styling */
.file-list::-webkit-scrollbar {
    width: 8px;
}

.file-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb {
    background: rgba(0, 230, 118, 0.3);
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 230, 118, 0.5);
}

/* File Preview Panel - Fixed and Responsive */
.file-preview-panel {
    width: 40%;
    min-width: 300px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    background: var(--card-black);
    position: relative;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-dark);
    background: var(--card-black);
    position: sticky;
    top: 0;
    z-index: 10;
}

.preview-header h4 {
    color: var(--primary-cyan);
    font-size: 1rem;
    margin: 0;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.preview-action-btn {
    padding: 0.3rem 0.6rem;
    background: var(--pure-black);
    border: 1px solid var(--cyan-dim);
    border-radius: 3px;
    color: var(--cyan-text);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.preview-action-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.preview-close {
    width: 25px;
    height: 25px;
    background: var(--pure-black);
    border: 1px solid var(--text-secondary);
    border-radius: 3px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.preview-close:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.preview-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.preview-text {
    width: 100%;
    height: 100%;
    padding: 1rem;
    background: var(--pure-black);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--cyan-text);
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
}

.preview-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.preview-info {
    padding: 1rem;
    border-top: 1px solid var(--border-dark);
    font-size: 0.8rem;
    background: var(--card-black);
}

.preview-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
}

.preview-info-row span:first-child {
    color: var(--text-secondary);
    margin-right: 1rem;
}

.preview-info-row span:last-child {
    color: var(--cyan-text);
    word-break: break-all;
}

/* File Preview Panel - Responsive */
.file-preview-panel {
    width: 400px;
    min-width: 300px;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    background: var(--card-black);
    resize: horizontal;
    overflow: auto;
    position: relative;
}

.file-preview-panel::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: ew-resize;
    background: transparent;
}

.file-preview-panel:hover::after {
    background: var(--cyan-dim);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-dark);
    position: sticky;
    top: 0;
    background: var(--card-black);
    z-index: 10;
}

.preview-header h4 {
    color: var(--primary-cyan);
    font-size: 1rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-right: 0.5rem;
}

.preview-action-btn {
    padding: 0.3rem 0.6rem;
    background: var(--pure-black);
    border: 1px solid var(--cyan-dim);
    border-radius: 3px;
    color: var(--cyan-text);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.preview-action-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.preview-close {
    width: 25px;
    height: 25px;
    background: var(--pure-black);
    border: 1px solid var(--text-secondary);
    border-radius: 3px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-close:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.preview-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
    max-height: calc(100% - 200px);
}

.preview-text {
    width: 100%;
    padding: 1rem;
    background: var(--pure-black);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--cyan-text);
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    max-height: none;
}

.preview-placeholder {
    text-align: center;
    color: var(--text-secondary);
}
/* Header Controls Layout */
.header-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    gap: 10px;
    transition: all 0.3s;
    min-width: 300px;
}

.search-box:focus-within {
    border-color: #00e676;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.2);
}

.search-icon {
    font-size: 1.2rem;
    color: #00e676;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.preview-info {
    padding: 1rem;
    border-top: 1px solid var(--border-dark);
    font-size: 0.8rem;
}

.preview-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
}

.preview-info-row span:first-child {
    color: var(--text-secondary);
}

.preview-info-row span:last-child {
    color: var(--cyan-text);
}

/* Loading */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-dark);
    border-top-color: var(--primary-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    height: 100%;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 1rem;
    opacity: 0.7;
}
/* Download Indicator */
.download-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    background: var(--card-black);
    border: 2px solid var(--cyan-dim);
    border-radius: 8px;
    z-index: 9999;
    display: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.3);
}

.download-indicator.active {
    display: block;
    animation: slideInRight 0.3s ease;
}

.download-indicator.expanded .download-list {
    max-height: 400px;
    opacity: 1;
}

.download-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--pure-black), var(--card-black));
    border-bottom: 1px solid var(--cyan-dim);
    cursor: pointer;
    user-select: none;
}

.download-header span {
    color: var(--primary-cyan);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.download-header button {
    background: none;
    border: none;
    color: var(--cyan-text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-list {
    max-height: 0;
    opacity: 0;
    overflow-y: auto;
    transition: all 0.3s ease;
    background: var(--pure-black);
}

.download-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
    animation: fadeIn 0.3s ease;
}

.download-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.download-name {
    color: var(--cyan-text);
    font-size: 0.9rem;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
}

.download-progress {
    color: var(--primary-cyan);
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 45px;
    text-align: right;
}

.download-complete {
    color: #00e676;
    font-size: 1rem;
    font-weight: 700;
}

.download-error {
    color: #ff1744;
    font-size: 1rem;
    font-weight: 700;
}

.progress-bar {
    height: 6px;
    background: rgba(0, 229, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan-dim), var(--primary-cyan));
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--pure-black);
}

::-webkit-scrollbar-thumb {
    background: var(--cyan-dim);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-cyan);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-content {
        padding: 1rem;
    }
    
    .devices-table {
        min-width: 700px;
    }
    .bot-floating-btn {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }
    
    .bot-emoji {
        font-size: 2rem;
    }
    
    .bot-chat-box {
        width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        bottom: 100px;
        right: 20px;
        left: 20px;
    }
    
    .bot-chat-box.active {
        height: calc(100vh - 180px);
        max-height: calc(100vh - 180px);
    }
    
    .bot-title {
        font-size: 1rem;
    }
    
    .bot-emoji-large {
        font-size: 2rem;
    }
    .nav-brand span:not(.brand-logo) {
        display: none;
    }
    .search-input-expandable.active {
        width: 200px;
    }
    .lang-switch-mini {
        display: none;
    }
    
    .file-explorer {
        flex-direction: column;
    }
    
    .file-preview-panel {
        width: 100%;
        height: 300px;
        border-right: none;
        border-top: 1px solid var(--border-dark);
    }
    .header-controls {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .status-indicators {
        flex-wrap: wrap;
        width: 100%;
    }
    .modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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