/* PROJECT SHAKTI - Iron Man / J.A.R.V.I.S. Arc Reactor 3D HUD Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Mark LXXXV Aesthetic Color Palette */
    --bg-dark: #050811;
    --bg-card: rgba(11, 18, 32, 0.85);
    --bg-card-hover: rgba(16, 26, 48, 0.95);
    
    --border-color: rgba(0, 240, 255, 0.3);
    --border-color-glow: rgba(0, 240, 255, 0.8);
    
    /* Key HUD Accent Colors */
    --cyan-core: #00f0ff;
    --cyan-pulse: #7df9ff;
    --cyan-glow: rgba(0, 240, 255, 0.4);
    
    --gold-titanium: #ffd700;
    --gold-metallic: #d4af37;
    --gold-glow: rgba(255, 215, 0, 0.4);
    
    --crimson-red: #e63946;
    --repulsor-red: #ff4757;
    --red-glow: rgba(255, 71, 87, 0.5);

    --text-main: #f0f4f8;
    --text-muted: #8a99ad;
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;

    --font-hud: 'Orbitron', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Cyberpunk Theme Option */
[data-theme="cyberpunk"] {
    --bg-dark: #070913;
    --bg-card: rgba(15, 18, 38, 0.85);
    --border-color: rgba(255, 0, 128, 0.4);
    --border-color-glow: rgba(0, 240, 255, 0.8);
    --cyan-core: #ff0080;
    --cyan-glow: rgba(255, 0, 128, 0.5);
    --gold-titanium: #00f0ff;
}

/* Electric Blue Theme Option */
[data-theme="electric_blue"] {
    --bg-dark: #040914;
    --bg-card: rgba(8, 20, 40, 0.85);
    --border-color: rgba(56, 189, 248, 0.4);
    --border-color-glow: rgba(56, 189, 248, 0.8);
    --cyan-core: #38bdf8;
    --cyan-glow: rgba(56, 189, 248, 0.5);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(0, 240, 255, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 15% 85%, rgba(255, 215, 0, 0.08) 0%, transparent 45%),
        linear-gradient(to bottom, rgba(5, 8, 17, 0.95), rgba(5, 8, 17, 0.98));
    background-attachment: fixed;
}

/* Scanline Sweep Effect */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 99;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    opacity: 0.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-hud);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--cyan-core);
}

/* Layout Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 270px;
    background: rgba(5, 8, 17, 0.92);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s ease;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    position: relative;
}

.brand-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--cyan-core);
    box-shadow: 0 0 10px var(--cyan-core);
}

.brand-logo {
    width: 46px;
    height: 46px;
    background: radial-gradient(circle, var(--cyan-core) 0%, rgba(5, 8, 17, 0.9) 70%);
    border: 2px solid var(--cyan-core);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-hud);
    font-weight: 900;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 0 20px var(--cyan-glow), inset 0 0 10px var(--cyan-core);
    animation: arcGlowPulse 2.5s infinite alternate;
}

@keyframes arcGlowPulse {
    0% { box-shadow: 0 0 15px var(--cyan-glow), inset 0 0 8px var(--cyan-core); }
    100% { box-shadow: 0 0 30px var(--cyan-core), inset 0 0 15px var(--cyan-pulse); }
}

.brand-title {
    font-family: var(--font-hud);
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--cyan-glow);
}

.brand-subtitle {
    font-family: var(--font-hud);
    font-size: 0.65rem;
    color: var(--gold-titanium);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex-grow: 1;
}

/* HUD Navigation Item with Chamfered Edges */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-hud);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.8px;
    transition: all 0.25s ease;
    cursor: pointer;
    background: rgba(11, 18, 32, 0.4);
    border: 1px solid rgba(0, 240, 255, 0.15);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    position: relative;
}

.nav-item i {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.nav-item:hover, .nav-item.active {
    color: #fff;
    background: var(--bg-card);
    border-color: var(--cyan-core);
    box-shadow: 0 0 15px var(--cyan-glow);
}

.nav-item.active {
    border-color: var(--cyan-core);
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.2), transparent);
}

.nav-item.active i {
    color: var(--cyan-core);
    text-shadow: 0 0 8px var(--cyan-core);
}

/* User Badge in Sidebar */
.sidebar-user {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold-titanium) 0%, #000 80%);
    border: 2px solid var(--gold-titanium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-hud);
    font-weight: 800;
    color: #000;
    box-shadow: 0 0 12px var(--gold-glow);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-family: var(--font-hud);
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.user-status {
    font-size: 0.7rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan-core);
    box-shadow: 0 0 8px var(--cyan-core);
    animation: blinkDot 1.5s infinite;
}

@keyframes blinkDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Main Content Workspace */
.main-content {
    margin-left: 270px;
    flex-grow: 1;
    padding: 2rem;
    min-height: 100vh;
}

/* Top Action Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px var(--cyan-glow);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--cyan-core), var(--gold-titanium));
    color: #000;
    font-family: var(--font-hud);
    font-weight: 800;
    padding: 0.7rem 1.4rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: all 0.25s ease;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    box-shadow: 0 0 20px var(--cyan-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--cyan-core);
}

.btn-secondary {
    background: rgba(11, 18, 32, 0.8);
    color: #fff;
    font-family: var(--font-hud);
    font-weight: 600;
    border: 1px solid var(--border-color);
    padding: 0.7rem 1.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: all 0.25s ease;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.btn-secondary:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--cyan-core);
    box-shadow: 0 0 15px var(--cyan-glow);
}

/* Glassmorphism HUD Card Containers with Chamfered Corners */
.glass-card, .hud-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(0, 240, 255, 0.05);
    transition: all 0.3s ease;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
    position: relative;
}

.glass-card:hover, .hud-card:hover {
    border-color: var(--border-color-glow);
    box-shadow: 0 0 25px var(--cyan-glow), inset 0 0 20px rgba(0, 240, 255, 0.1);
}

/* 3D Arc Reactor Visualizer Card */
.visualizer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(0, 240, 255, 0.1) 0%, var(--bg-card) 75%);
    min-height: 380px;
}

#arcReactorContainer {
    width: 100%;
    height: 240px;
    margin: 0.5rem 0;
    position: relative;
}

.voice-status-pill {
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    background: rgba(5, 8, 17, 0.85);
    border: 1px solid var(--border-color);
    font-family: var(--font-hud);
    font-size: 0.75rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 0 12px var(--cyan-glow);
}

.mic-btn-large {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--cyan-core) 0%, #000 85%);
    border: 2px solid var(--cyan-core);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px var(--cyan-glow);
    transition: all 0.3s ease;
    margin-top: 0.25rem;
}

.mic-btn-large:hover, .mic-btn-large.recording {
    transform: scale(1.1);
    box-shadow: 0 0 45px var(--cyan-core);
    border-color: var(--gold-titanium);
    color: var(--gold-titanium);
}

/* Chat Console */
.chat-input-container {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    background: rgba(5, 8, 17, 0.6);
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.chat-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-body);
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.85rem;
    font-family: var(--font-hud);
}

.custom-table th, .custom-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.custom-table th {
    color: var(--cyan-core);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.custom-table tbody tr {
    transition: background 0.2s ease;
}

.custom-table tbody tr:hover {
    background: rgba(0, 240, 255, 0.05);
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: var(--font-hud);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-whatsapp { background: rgba(46, 213, 115, 0.2); color: #2ed573; border: 1px solid rgba(46, 213, 115, 0.4); }
.badge-wabiz { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.badge-sms { background: rgba(255, 165, 2, 0.2); color: #ffa502; border: 1px solid rgba(255, 165, 2, 0.4); }

.badge-incoming { background: rgba(46, 213, 115, 0.15); color: #2ed573; }
.badge-outgoing { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 17, 0.9);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--bg-dark);
    border: 1px solid var(--cyan-core);
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 0 40px var(--cyan-glow);
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.transcript-bubble {
    background: rgba(0, 240, 255, 0.05);
    border-left: 3px solid var(--cyan-core);
    padding: 1rem;
    margin-top: 1rem;
    font-family: monospace;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}
