:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --accent: #10b981;
    --bg-dark: #09090b;
    --card-dark: #121217;
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --border-color: rgba(255, 255, 255, 0.08);

    --bg-main: #06070a;
    --secondary: #00d1ff;
    --panel: rgba(15, 23, 42, 0.4);
    --border: rgba(255, 255, 255, 0.08);
    --glow: rgba(99, 102, 241, 0.3);
    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

body {
    margin: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
}

.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
}

.navbar-container {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 1000;
    padding: 0 20px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(13, 13, 18, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 12px;
    width: 100%;
    max-width: 1200px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.nav-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.nav-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    background: linear-gradient(to right, #818cf8, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.core-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s ease;
    font-size: 0.9rem;
}

.core-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--glow);
}

.brand {
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    color: #fff;
}

.brand-bold {
    font-weight: 800;
    color: var(--primary);
}

.status-tag {
    font-size: 0.7rem;
    color: #818cf8;
    font-weight: 700;
    letter-spacing: 0.1em;
    background: rgba(99, 102, 241, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.frame-layout {
    flex: 1;
    display: flex;
    position: relative;
    margin-top: 0;
}

#viewport-container {
    flex: 1;
    position: relative;
    background: #000;
    z-index: 1;
}

.control-panel {
    width: 320px;
    position: absolute;
    left: 20px;
    top: 100px;
    bottom: 20px;
    background: rgba(13, 13, 18, 0.7);
    backdrop-filter: blur(20px);
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    z-index: 20;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.control-panel label {
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}


.monitor-cluster {
    position: absolute;
    right: 24px;
    top: 24px;
    width: 300px;
    z-index: 20;
}

.monitor-frame {
    background: transparent;
    border: none;
    padding: 16px;
    backdrop-filter: none;
}

.monitor-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
    letter-spacing: 0.1em;
}

.pulse-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
}

canvas#ecg-canvas {
    width: 100%;
    height: 90px;
}

.ui-segment {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@keyframes scan-loop {
    0% {
        transform: translateY(-40px);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(40px);
        opacity: 0;
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.neural-scanner {
    width: 80px;
    height: 80px;
    border: 2px solid rgba(0, 209, 255, 0.2);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(0, 209, 255, 0.1) 0%, transparent 70%);
}

.scan-beam {
    width: 100%;
    height: 2px;
    background: var(--secondary);
    box-shadow: 0 0 15px var(--secondary);
    position: absolute;
    animation: scan-loop 2s ease-in-out infinite;
}

.core-pulse {
    width: 20px;
    height: 20px;
    background: var(--secondary);
    border-radius: 50%;
    position: relative;
}

.core-pulse::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    animation: pulse-ring 1.5s linear infinite;
}

.segment-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.15em;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
}

.input-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 140px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 8px var(--glow);
}

.overlay-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: 0.3s;
}

.overlay-modal.active {
    display: flex;
    opacity: 1;
}

.modal-base {
    background: transparent;
    width: 95%;
    max-width: 1100px;
    max-height: 92vh;
    border-radius: 20px;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-top {
    padding: 24px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-inner {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.data-preview {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.highlight-text {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 20px var(--glow);
}

.analysis-block {
    margin-bottom: 32px;
}

.block-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 16px;
    letter-spacing: 0.1em;
}

.grid-visuals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.visual-item img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    backdrop-filter: blur(5px);
}

.terminal-box pre {
    margin: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    color: var(--secondary);
    font-size: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
    backdrop-filter: blur(5px);
    border: 1px solid var(--border);
}

.action-trigger {
    width: 100%;
    margin-top: 20px;
    background: linear-gradient(135deg, #00d1ff 0%, #3b82f6 100%);
    border: none;
    border-radius: 14px;
    padding: 14px;
    color: #000;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
}

.action-trigger:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 209, 255, 0.4);
}

.slider-eye-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eye-toggle {
    width: 16px;
    height: 16px;
    cursor: pointer;
    opacity: 0.4;
    transition: 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d1ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'%3E%3C/path%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

.eye-toggle:hover {
    opacity: 1;
}

.eye-toggle.active {
    opacity: 1;
}

#detailed-inspection-section {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 300px;
    background: rgba(6, 7, 10, 0.95);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    z-index: 1000;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #334155;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 8px var(--glow);
}

.overlay-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: 0.3s;
}

.overlay-modal.active {
    display: flex;
    opacity: 1;
}

.modal-base {
    background: transparent;
    width: 95%;
    max-width: 1100px;
    max-height: 92vh;
    border-radius: 20px;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-top {
    padding: 24px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-inner {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.data-preview {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.highlight-text {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 20px var(--glow);
}

.analysis-block {
    margin-bottom: 32px;
}

.block-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 16px;
    letter-spacing: 0.1em;
}

.grid-visuals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.visual-item img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    backdrop-filter: blur(5px);
}

.terminal-box pre {
    margin: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    color: var(--secondary);
    font-size: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
    backdrop-filter: blur(5px);
    border: 1px solid var(--border);
}

.action-trigger {
    width: 100%;
    margin-top: 20px;
    background: linear-gradient(135deg, #00d1ff 0%, #3b82f6 100%);
    border: none;
    border-radius: 14px;
    padding: 14px;
    color: #000;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
}

.action-trigger:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 209, 255, 0.4);
}

.slider-eye-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eye-toggle {
    width: 16px;
    height: 16px;
    cursor: pointer;
    opacity: 0.4;
    transition: 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d1ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'%3E%3C/path%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

.eye-toggle:hover {
    opacity: 1;
}

.eye-toggle.active {
    opacity: 1;
}

#detailed-inspection-section {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 300px;
    background: rgba(6, 7, 10, 0.95);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    z-index: 1000;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #334155;
    transition: .4s;
    border-radius: 20px;
}

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

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

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

/* History Sidebar */
.history-panel {
    position: fixed;
    right: -350px;
    top: 64px;
    bottom: 0;
    width: 320px;
    background: rgba(6, 7, 10, 0.95);
    backdrop-filter: blur(24px);
    border-left: 1px solid var(--border);
    z-index: 900;
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
}

.history-panel.active {
    right: 0;
}

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

.history-header h3 {
    margin: 0;
    font-size: 0.8rem;
    color: var(--secondary);
    letter-spacing: 0.1em;
}

.history-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
}

.history-date {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
}

.history-diagnosis {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.history-bpm {
    font-size: 0.7rem;
    color: var(--secondary);
    font-weight: 600;
}

.prediction-box {
    background: transparent;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    text-align: center;
    margin-bottom: 24px;
}

/* Chat Bot Interface */
.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px var(--glow);
    z-index: 1000;
    transition: 0.3s;
    border: none;
}

.chat-fab:hover {
    transform: scale(1.1) rotate(10deg);
}

.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: rgba(6, 7, 10, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    overflow: hidden;
}

.chat-window.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.chat-header {
    padding: 16px;
    background: rgba(6, 7, 10, 0.5);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #fff;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 80%;
    word-wrap: break-word;
}

.message.bot {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #e2e8f0;
    align-self: flex-start;
    border-top-left-radius: 2px;
}

.message.user {
    background: var(--primary);
    color: #000;
    font-weight: 600;
    align-self: flex-end;
    border-top-right-radius: 2px;
}

.message img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
}

.chat-input-area {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    resize: none;
    height: 40px;
    padding: 8px;
    outline: none;
    font-size: 0.85rem;
}

.chat-send-btn {
    background: var(--secondary);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: 0.2s;
}

.chat-send-btn:hover {
    background: var(--primary);
    color: #000;
}

/* Enhanced UI Components */
.nav-action-btn {
    background: rgba(0, 209, 255, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;

}

.nav-action-btn:hover {
    background: var(--secondary);
    color: #000;
    box-shadow: 0 0 15px var(--secondary);

}

.nav-action-btn.secondary {
    border-color: #facc15;
    color: #facc15;
    background: rgba(250, 204, 21, 0.1);

}

.nav-action-btn.secondary:hover {
    background: #facc15;
    color: #000;
    box-shadow: 0 0 15px #facc15;

}

.chat-icon-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 8px;
    transition: 0.2s;

}

.chat-icon-btn:hover,
.chat-icon-btn.active {
    color: var(--secondary);

}

.chat-icon-btn.listening {
    color: #ef4444;
    animation: pulse-red 1s infinite;

}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        opacity: 1;

    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;

    }

    100% {
        transform: scale(1);
        opacity: 1;

    }


}

/* Glassmorphism AI Assistant UI */
.chat-window {
    background: rgba(13, 17, 23, 0.7) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8) !important;

}

.chat-header {
    background: rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;

}

.message.bot {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #f1f5f9 !important;

}

.message table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;

}

.message th,
.message td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px;
    text-align: left;

}

.message th {
    background: rgba(0, 209, 255, 0.2);
    color: var(--secondary);

}

.chat-action-bar {
    display: flex;
    padding: 10px 15px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);

}

.chat-sub-btn {
    flex: 1;
    background: rgba(0, 209, 255, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    border-radius: 6px;
    font-size: 0.7rem;
    padding: 5px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;

}

.chat-sub-btn:hover {
    background: var(--secondary);
    color: #000;

}

.chat-icon-btn svg {
    width: 20px;
    height: 20px;

}

.chat-input-area {
    background: rgba(0, 0, 0, 0.3) !important;
    padding: 15px !important;

}

.chat-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    height: 45px !important;

}

/* Ultra-Advanced Floating Transparent AI UI */
.chat-window {
    background: rgba(10, 15, 25, 0.4) !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6) !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;

}

.chat-header {
    background: transparent !important;
    border: none !important;
    padding: 20px !important;
    backdrop-filter: none !important;

}

.chat-header span {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 0 10px rgba(0, 209, 255, 0.5);

}

.chat-action-bar {
    background: transparent !important;
    border: none !important;
    justify-content: center !important;
    padding: 0 15px 15px !important;
    gap: 12px !important;

}

.chat-sub-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 10px 15px !important;
    font-size: 0.75rem !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: #fff !important;

}

.chat-sub-btn:hover {
    background: var(--primary) !important;
    color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--glow) !important;

}

.chat-messages {
    background: transparent !important;
    padding: 20px !important;

}

.message {
    border-radius: 16px !important;
    padding: 12px 16px !important;
    max-width: 85% !important;
    margin-bottom: 20px !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    backdrop-filter: blur(8px) !important;

}

.message.bot {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-bottom-left-radius: 4px !important;

}

.message.user {
    background: rgba(0, 209, 255, 0.15) !important;
    border: 1px solid var(--primary) !important;
    border-bottom-right-radius: 4px !important;
    align-self: flex-end;

}

.chat-input-area {
    background: transparent !important;
    border: none !important;
    padding: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;

}

.chat-input {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 18px !important;
    height: 50px !important;
    color: #fff !important;
    padding: 12px 20px !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;

}

.chat-icon-btn,
.chat-send-btn {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: 0.3s !important;

}

.chat-icon-btn:hover,
.chat-send-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.05);

}

.chat-send-btn {
    background: var(--primary) !important;
    border: none !important;
    color: #000 !important;
    box-shadow: 0 0 20px var(--glow) !important;

}

.chat-send-btn svg {
    filter: brightness(0);

}

.chat-icon-btn.listening {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4) !important;

}

/* Hide scrollbar for messages but allow scrolling */
.chat-messages::-webkit-scrollbar {
    width: 4px;

}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;

}

/* Message Alignment Fixes */
.chat-messages {
    display: flex !important;
    flex-direction: column !important;

}

.message.user {
    align-self: flex-end !important;
    background: rgba(0, 209, 255, 0.2) !important;
    border: 1px solid var(--primary) !important;
    color: #fff !important;

}

.message.bot {
    align-self: flex-start !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;

}

/* Table styling in transparent mode */
.table-container {
    overflow-x: auto;
    margin: 10px 0;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);

}

table {
    width: 100%;
    border-collapse: collapse;

}

th {
    background: rgba(0, 209, 255, 0.1);
    color: var(--secondary);
    font-weight: 700;
    padding: 8px;
    text-align: left;
    font-size: 0.8rem;

}

td {
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);

}


/* Advanced Analysis Styles */
.metric-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: 0.3s;
}

.metric-card:hover {
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.6);
}

.metric-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
}

.chart-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.chart-title {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}