/* style.css - Modern Responsive Glassmorphism Design System */

:root {
    --bg-dark: #070A13;
    --card-bg: rgba(13, 20, 38, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    /* Vibrant Electric Accents */
    --purple-magic: #8B5CF6;
    --purple-glow: rgba(139, 92, 246, 0.35);
    --cyan-electric: #06B6D4;
    --cyan-glow: rgba(6, 182, 212, 0.35);
    --emerald-green: #10B981;
    --emerald-glow: rgba(16, 185, 129, 0.25);
    --rose-red: #F43F5E;
    --rose-glow: rgba(244, 63, 94, 0.25);
    
    /* Fonts */
    --font-primary: 'Inter', sans-serif;
    --font-header: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    font-family: var(--font-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 50px;
}

/* Ambient Glow Blobs in Background */
.ambient-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.12;
    z-index: -1;
    pointer-events: none;
}

.bg-purple {
    background: var(--purple-magic);
    top: -150px;
    right: -100px;
}

.bg-cyan {
    background: var(--cyan-electric);
    bottom: -150px;
    left: -100px;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-magic);
}

/* Main Container Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Glassmorphism Generic Card */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Header Bar Styling */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 26px;
    background: linear-gradient(135deg, var(--cyan-electric), var(--purple-magic));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-title {
    font-family: var(--font-header);
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 1px;
}

.logo-subtitle {
    font-family: var(--font-header);
    font-weight: 400;
    font-size: 16px;
    color: var(--text-secondary);
    border-left: 1px solid rgba(255,255,255,0.15);
    padding-left: 10px;
    margin-left: 5px;
}

.header-tag {
    font-size: 12px;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #A78BFA;
    padding: 6px 14px;
    border-radius: 20px;
}

/* Upload Section */
.upload-section {
    padding: 40px;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: all 0.3s ease;
}

.upload-area.highlight {
    border-color: var(--cyan-electric);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 20px var(--cyan-glow);
}

.upload-icon-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon-container {
    background: rgba(6, 182, 212, 0.08);
    border-color: var(--cyan-electric);
    transform: translateY(-5px);
}

.cloud-icon {
    font-size: 32px;
    color: var(--cyan-electric);
}

.upload-area h3 {
    font-family: var(--font-header);
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 600;
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.upload-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 15px;
}

.context-container {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.context-container label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.context-container input {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

.context-container input:focus {
    outline: none;
    border-color: var(--purple-magic);
    box-shadow: 0 0 10px var(--purple-glow);
    background: rgba(255,255,255,0.05);
}

/* Universal Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan-electric), var(--purple-magic));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255,255,255,0.2);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    color: #FDA4AF;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: var(--rose-red);
}

/* Loading Card */
.loading-card {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}

.loader-circle {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top: 4px solid var(--cyan-electric);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 24px;
}

.loading-card h3 {
    font-family: var(--font-header);
    font-size: 22px;
    margin-bottom: 8px;
}

.loading-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 400px;
}

.progress-bar-container {
    width: 100%;
    max-width: 450px;
    height: 6px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    width: 10%;
    height: 100%;
    background: linear-gradient(90deg, var(--cyan-electric), var(--purple-magic));
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Dashboard Workspace Grid */
.dashboard-workspace {
    display: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.3fr repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

/* Health score widget */
.health-card {
    display: flex;
    align-items: center;
    gap: 24px;
}

.health-gauge-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.6s ease;
    stroke-dasharray: 314.16;
    stroke-dashoffset: 314.16;
}

.health-score-value {
    position: absolute;
    font-family: var(--font-header);
    font-weight: 800;
    font-size: 26px;
    background: linear-gradient(135deg, var(--cyan-electric), var(--purple-magic));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.health-meta h4 {
    font-family: var(--font-header);
    font-size: 18px;
    margin-bottom: 4px;
}

.health-meta p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
}

.stat-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.bg-blue-trans { background: rgba(6, 182, 212, 0.08); border: 1px solid rgba(6, 182, 212, 0.15); }
.bg-purple-trans { background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.15); }
.bg-red-trans { background: rgba(244, 63, 94, 0.08); border: 1px solid rgba(244, 63, 94, 0.15); }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 24px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* Schema Table controls */
.table-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
}

.search-bar-wrapper {
    position: relative;
    flex: 1;
    max-width: 600px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
}

.search-bar-wrapper input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 12px 16px 12px 48px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

.search-bar-wrapper input:focus {
    outline: none;
    border-color: var(--cyan-electric);
    box-shadow: 0 0 10px var(--cyan-glow);
    background: rgba(255,255,255,0.05);
}

.export-actions {
    display: flex;
    gap: 12px;
}

/* Premium Schema Table Design */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.1);
}

.dictionary-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.dictionary-table th {
    background: rgba(255,255,255,0.02);
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.dictionary-table td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: top;
    color: var(--text-primary);
    line-height: 1.5;
}

.dictionary-table tr:hover td {
    background: rgba(255,255,255,0.01);
}

/* Badge Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.badge-primary-key { background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.3); color: #22D3EE; }
.badge-category { background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.3); color: #C084FC; }
.badge-date { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #34D399; }
.badge-numeric { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #FBBF24; }
.badge-text { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--text-secondary); }

/* Indicators list */
.indicator-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.indicator-item {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.bg-dot-green { background-color: var(--emerald-green); box-shadow: 0 0 6px var(--emerald-glow); }
.bg-dot-yellow { background-color: #F59E0B; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.bg-dot-red { background-color: var(--rose-red); box-shadow: 0 0 6px var(--rose-glow); }

/* Highlighted sample */
.sample-code {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: monospace;
    color: #A78BFA;
    font-size: 11px;
    word-break: break-all;
    max-height: 80px;
    overflow-y: auto;
}

/* AI Prompt & Action panels */
.ai-desc-box {
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12.5px;
    position: relative;
    margin-bottom: 10px;
}

.ai-desc-title {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 11px;
    color: #A78BFA;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-recommendation {
    background: rgba(6, 182, 212, 0.04);
    border: 1px solid rgba(6, 182, 212, 0.12);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
}

.action-title {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 11px;
    color: #22D3EE;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Highlight Search Matching Text */
.highlight-text {
    background: rgba(245, 158, 11, 0.3);
    color: white;
    border-radius: 2px;
    padding: 0 2px;
}

/* Text highlights colors */
.text-purple { color: #A78BFA; }
.text-cyan { color: #22D3EE; }
.text-red { color: #FDA4AF; }

/* Dynamic Animations Keyframes */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

/* Active buttons for chart and DDL tabs */
.chart-tab.btn-active,
.sql-tab.btn-active {
    background: linear-gradient(135deg, var(--cyan-electric), var(--purple-magic)) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.35) !important;
}

/* Slide-out Drawer UI */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.side-drawer {
    position: fixed;
    top: 0;
    right: -600px;
    width: 550px;
    max-width: 100%;
    height: 100vh;
    margin-bottom: 0;
    border-radius: 20px 0 0 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.side-drawer.open {
    right: 0;
}

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

.drawer-content {
    flex: 1;
}

.outlier-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.outlier-val {
    font-size: 24px;
    font-family: var(--font-header);
    color: var(--rose-red);
    font-weight: 700;
    margin-bottom: 10px;
}

.outlier-context {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.ai-explanation-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.btn-investigate {
    margin-top: 8px;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 15px;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #FDA4AF;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-investigate:hover {
    background: rgba(244, 63, 94, 0.3);
    box-shadow: 0 0 10px var(--rose-glow);
}

/* Chat Messages UI */
.chat-msg {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.chat-msg.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg.ai-msg {
    align-self: flex-start;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-msg .msg-avatar {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #22D3EE;
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
}

.user-msg .msg-bubble {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.2);
    border-top-right-radius: 2px;
}

.ai-msg .msg-bubble {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
    border-top-left-radius: 2px;
}

.code-block {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    color: #A78BFA;
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-all;
}

.chat-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    overflow: hidden;
}

.chat-table th {
    background: rgba(255,255,255,0.05);
    padding: 8px;
    text-align: left;
    color: var(--text-secondary);
}

.chat-table td {
    padding: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

