/* -------------------------------------------------------------
   KaroonaX Digital Twin Platform Design System
------------------------------------------------------------- */

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: rgba(17, 24, 39, 0.8);
    --bg-panel: rgba(30, 41, 59, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    /* Neon Accents */
    --accent-blue: #00f2fe;
    --accent-green: #38ef7d;
    --accent-purple: #b92b27;
    --accent-glow-purple: #d500f9;
    --accent-orange: #ff9100;
    --accent-red: #ff1744;
    
    --glass-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --neon-blue-glow: 0 0 15px rgba(0, 242, 254, 0.4);
    --neon-green-glow: 0 0 15px rgba(56, 239, 125, 0.4);
    --neon-red-glow: 0 0 15px rgba(255, 23, 68, 0.4);
    
    --font-ui: 'Outfit', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-ui);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* -------------------------------------------------------------
   App Container & Header
------------------------------------------------------------- */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 10px;
    gap: 10px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    box-shadow: var(--glass-glow);
    height: 65px;
    flex-shrink: 0;
}

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

.logo-icon {
    font-size: 28px;
    color: var(--accent-blue);
    text-shadow: var(--neon-blue-glow);
    animation: pulseGlow 3s infinite ease-in-out;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-karoona {
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 0.5px;
}

.brand-x {
    font-weight: 800;
    font-size: 22px;
    color: var(--accent-green);
    text-shadow: 0 0 8px rgba(56, 239, 125, 0.6);
}

.tagline {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: -2px;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
    animation: flash 1.5s infinite;
}

.pulse-dot-orange {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-orange);
    box-shadow: 0 0 10px var(--accent-orange);
    animation: flash 1.5s infinite;
}

.header-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-blue);
    box-shadow: var(--neon-blue-glow);
}

/* -------------------------------------------------------------
   Layout Structure
------------------------------------------------------------- */
.main-content {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 10px;
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    box-shadow: var(--glass-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.panel-header i {
    color: var(--accent-blue);
    font-size: 18px;
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* -------------------------------------------------------------
   Left Panel: Component Library
------------------------------------------------------------- */
.left-panel {
    width: 280px;
    flex-shrink: 0;
}

.library-desc {
    padding: 12px 18px 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.components-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lib-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.lib-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.lib-card.placement-active {
    border-color: var(--accent-blue);
    box-shadow: var(--neon-blue-glow);
    background: rgba(0, 242, 254, 0.08);
}

.lib-card:active {
    cursor: grabbing;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    font-size: 18px;
    flex-shrink: 0;
}

.icon-blue { background: rgba(0, 242, 254, 0.15); color: var(--accent-blue); }
.icon-green { background: rgba(56, 239, 125, 0.15); color: var(--accent-green); }
.icon-purple { background: rgba(185, 43, 39, 0.15); color: #c084fc; }
.icon-orange { background: rgba(255, 145, 0, 0.15); color: var(--accent-orange); }
.icon-red { background: rgba(255, 23, 68, 0.15); color: var(--accent-red); }

.card-details h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.card-details p {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

.datastore-connect-section {
    padding: 14px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.datastore-connect-section i {
    color: var(--accent-blue);
    margin-top: 2px;
}

/* -------------------------------------------------------------
   Center Panel: Workplace Grid Canvas
------------------------------------------------------------- */
.workplace-panel {
    flex: 1;
}

.canvas-dimensions {
    margin-left: auto;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
}

.canvas-wrapper {
    flex: 1;
    overflow: auto;
    position: relative;
    background-color: #080c14;
}

.canvas-grid {
    position: relative;
    width: 1000px;
    height: 600px;
    background-size: 25px 25px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

.connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* -------------------------------------------------------------
   Canvas Nodes (Dropped items)
------------------------------------------------------------- */
.canvas-node {
    position: absolute;
    width: 140px;
    height: 120px;
    background: rgba(26, 36, 54, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: move;
    z-index: 2;
    transition: box-shadow 0.2s, border-color 0.2s;
    user-select: none;
}

.canvas-node:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.15);
}

.canvas-node.selected {
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.35);
    background: rgba(30, 48, 80, 0.9);
}

.canvas-node .node-icon {
    font-size: 26px;
    margin-bottom: 8px;
}

.canvas-node .node-title {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.canvas-node .node-status {
    font-size: 9px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Special Node: Server DB */
.database-node {
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid var(--accent-blue);
    box-shadow: var(--neon-blue-glow);
    cursor: pointer;
    z-index: 3;
}

.database-node .node-icon {
    color: var(--accent-blue);
    animation: databasePulse 2s infinite ease-in-out;
}

.database-node .node-status {
    color: var(--accent-blue);
    font-weight: bold;
}

.db-glow-ring {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 16px;
    pointer-events: none;
    animation: pulseRing 2s infinite;
}

/* Node Connect Point indicators */
.node-port {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #1e293b;
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    right: -5px;
    top: calc(50% - 5px);
    cursor: pointer;
    z-index: 5;
}

.node-port:hover {
    background: var(--accent-blue);
    transform: scale(1.3);
}

/* -------------------------------------------------------------
   Right Panel: Properties & Logs
------------------------------------------------------------- */
.right-panel {
    width: 320px;
    flex-shrink: 0;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 14px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.04);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.empty-icon {
    font-size: 32px;
    margin-bottom: 15px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 13px;
    line-height: 1.5;
}

/* Property Panel Details */
.property-form-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.selected-node-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
}

.node-badge {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.selected-node-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.node-type-label {
    font-size: 9px;
    font-family: var(--font-mono);
    color: var(--accent-blue);
    letter-spacing: 0.5px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-left: 2px solid var(--accent-blue);
    padding-left: 8px;
    font-weight: 600;
}

.telemetry-inputs-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.telemetry-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.telemetry-row label {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.telemetry-val {
    font-family: var(--font-mono);
    color: var(--text-main);
    font-weight: bold;
}

.telemetry-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #1e293b;
    border-radius: 3px;
    outline: none;
}

.telemetry-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-blue);
    box-shadow: 0 0 6px var(--accent-blue);
    cursor: pointer;
    transition: transform 0.1s;
}

.telemetry-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Properties Grid Table */
.properties-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.properties-table th, .properties-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.properties-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.properties-table td {
    font-family: var(--font-mono);
}

.config-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-deactive { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.badge-display { background: rgba(56, 239, 125, 0.15); color: var(--accent-green); }
.badge-store { background: rgba(0, 242, 254, 0.15); color: var(--accent-blue); }
.badge-command { background: rgba(255, 145, 0, 0.15); color: var(--accent-orange); }

/* Action Buttons */
.action-buttons-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    background: rgba(56, 239, 125, 0.1);
    border: 1px solid rgba(56, 239, 125, 0.3);
    color: var(--accent-green);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:hover {
    background: rgba(56, 239, 125, 0.2);
    box-shadow: var(--neon-green-glow);
    border-color: var(--accent-green);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Datastore Log Tab */
.datastore-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.datastore-header h3 {
    font-size: 14px;
}

.db-records-count {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--accent-blue);
    background: rgba(0, 242, 254, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.db-stream-view {
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    overflow-y: auto;
}

.db-stream-view pre {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-blue);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.4;
}

/* -------------------------------------------------------------
   Bottom Panel: Factory Simulator
------------------------------------------------------------- */
.bottom-panel {
    height: 420px;
    flex-shrink: 0;
}

.title-with-pulse {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-with-pulse i {
    animation: flash 2s infinite ease-in-out;
}

.simulation-controls {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.sim-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-ui);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sim-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.sim-action-btn.warning {
    background: rgba(255, 23, 68, 0.15);
    border-color: rgba(255, 23, 68, 0.4);
    color: #ff4757;
}

.sim-action-btn.warning:hover {
    background: rgba(255, 23, 68, 0.25);
    border-color: var(--accent-red);
    box-shadow: var(--neon-red-glow);
}

.simulation-workspace {
    flex: 1;
    display: flex;
    background: #090c15;
    padding: 2px 6px;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.svg-sim-container {
    width: 100%;
    height: 100%;
    min-width: 1500px;
    min-height: 0;
}

#factory-floor-svg {
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: block;
}

/* Box elements */
.factory-box {
    transition: transform 0.1s linear;
}

/* -------------------------------------------------------------
   Context Menu (Right Click)
------------------------------------------------------------- */
.context-menu {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 242, 254, 0.2);
    z-index: 1000;
    width: 190px;
    padding: 6px 0;
    backdrop-filter: blur(10px);
}

.context-menu ul {
    list-style: none;
}

.context-menu li {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
}

.context-menu li:hover {
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-blue);
    padding-left: 20px;
}

.context-menu li.menu-danger:hover {
    background: rgba(255, 23, 68, 0.15);
    color: var(--accent-red);
}

.context-menu li i {
    width: 16px;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

/* -------------------------------------------------------------
   Modal Box Styling
------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 16, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-box {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 460px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    overflow: hidden;
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.1s;
}

.close-modal-btn:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border-color);
}

.modal-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.primary {
    background: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    color: var(--text-dark);
}

.modal-btn.primary:hover {
    box-shadow: var(--neon-blue-glow);
    background: #00e1ec;
}

.modal-btn.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.modal-btn.secondary:hover {
    background: rgba(255,255,255,0.05);
}

/* Modals inputs styling */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group-row {
    display: flex;
    gap: 12px;
}

.form-group-row .form-group {
    flex: 1;
}

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"], input[type="number"], select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--accent-blue);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
}

.checkbox-label input {
    cursor: pointer;
}

.checkbox-label i {
    width: 16px;
    text-align: center;
}

/* Setup Parameters Config Form fields */
.param-config-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.param-config-row label {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-main);
}

/* -------------------------------------------------------------
   Dynamic Notification Device Simulator (Floating overlays)
------------------------------------------------------------- */
.device-sim-wrapper {
    position: fixed;
    right: 20px;
    bottom: 260px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.device-sim-wrapper * {
    pointer-events: auto; /* Re-enable clicks inside */
}

/* Phone Mockup Frame */
.phone-frame {
    width: 260px;
    height: 480px;
    background: #111;
    border: 8px solid #222;
    border-radius: 36px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8), 0 0 15px rgba(0,0,0,0.5);
    overflow: hidden;
    position: relative;
    border-color: #2d3748;
    animation: slideInUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Dynamic screen notch */
.phone-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: calc(50% - 40px);
    width: 80px;
    height: 16px;
    background: #2d3748;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 20;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #000;
    position: relative;
    display: flex;
    flex-direction: column;
}

.phone-status-bar {
    height: 30px;
    padding: 4px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    margin-top: 1px;
}

.phone-status-icons {
    display: flex;
    gap: 4px;
}

.phone-app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1c2431;
    position: relative;
    overflow: hidden;
}

/* Call Simulator Screen */
.phone-call-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 30px 20px;
    background: linear-gradient(to bottom, #111827, #1f2937);
    color: white;
}

.caller-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 242, 254, 0.1);
    border: 2px solid var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--accent-blue);
    margin-top: 20px;
    box-shadow: var(--neon-blue-glow);
}

.caller-details {
    text-align: center;
}

.caller-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

.call-status {
    font-size: 12px;
    color: var(--accent-blue);
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

.call-status.ringing {
    animation: flash 1s infinite;
}

.call-actions {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-bottom: 20px;
}

.call-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.call-btn:hover {
    transform: scale(1.1);
}

.call-btn.decline {
    background: #ef4444;
}

.call-btn.accept {
    background: #22c55e;
}

.call-in-progress {
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    width: 100%;
    color: #e2e8f0;
}

/* WhatsApp Simulator Screen */
.wa-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0b141a; /* WhatsApp Dark Mode Background */
}

.wa-header {
    background: #075e54;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.wa-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #128c7e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.wa-header-info h4 {
    font-size: 13px;
    font-weight: 600;
}

.wa-header-info span {
    font-size: 9px;
    opacity: 0.8;
}

.wa-chat-area {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); /* Mock chat background */
    background-size: contain;
}

.wa-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    position: relative;
}

.wa-bubble.received {
    background: #202c33;
    color: white;
    align-self: flex-start;
    border-top-left-radius: 0;
}

.wa-bubble.sent {
    background: #005c4b;
    color: white;
    align-self: flex-end;
    border-top-right-radius: 0;
}

.wa-bubble-time {
    font-size: 9px;
    color: #8696a0;
    text-align: right;
    margin-top: 4px;
}

.wa-input-bar {
    padding: 8px;
    background: #1f2c34;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wa-input-field {
    flex: 1;
    background: #2a3942;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    color: white;
}

.wa-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #00a884;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SMS Simulator Screen */
.sms-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
}

.sms-header {
    background: #1a1a1a;
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #2a2a2a;
    color: white;
}

.sms-header h4 {
    font-size: 13px;
}

.sms-header span {
    font-size: 9px;
    color: #007aff;
}

.sms-chat-area {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sms-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 12px;
    line-height: 1.4;
}

.sms-bubble.received {
    background: #262629;
    color: white;
    align-self: flex-start;
}

.sms-bubble.sent {
    background: #007aff;
    color: white;
    align-self: flex-end;
}

/* Outlook Email Mockup Card */
.email-frame {
    width: 350px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.email-header {
    background: rgba(0,0,0,0.2);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.email-controls {
    display: flex;
    gap: 6px;
}

.email-controls span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.email-title {
    margin-left: 20px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.email-meta {
    padding: 12px 16px;
    background: rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.email-meta strong {
    color: var(--text-main);
}

.email-body {
    padding: 16px;
    font-size: 12px;
    line-height: 1.5;
    background: #111c2e;
    color: #e2e8f0;
    min-height: 100px;
}

/* -------------------------------------------------------------
   Help Guide Modal
------------------------------------------------------------- */
.help-btn-glow {
    background: rgba(0, 242, 254, 0.1) !important;
    border-color: rgba(0, 242, 254, 0.3) !important;
    color: var(--accent-blue) !important;
}

.help-btn-glow:hover {
    background: rgba(0, 242, 254, 0.2) !important;
    box-shadow: var(--neon-blue-glow) !important;
}

.help-modal {
    width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.help-body {
    overflow-y: auto;
    padding: 0 !important;
    flex: 1;
}

.help-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 10;
}

.help-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 12px 8px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.help-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.help-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.04);
}

.help-tab-content {
    display: none;
    padding: 20px;
}

.help-tab-content.active {
    display: block;
}

.help-tab-content h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-tab-content > p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Steps */
.help-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.help-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s;
}

.help-step:hover {
    background: rgba(0, 242, 254, 0.04);
    border-color: rgba(0, 242, 254, 0.2);
}

.step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), #4facfe);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.help-step strong {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.help-step p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

/* Tip Box */
.help-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 145, 0, 0.08);
    border: 1px solid rgba(255, 145, 0, 0.25);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 12px;
}

.help-tip i {
    color: var(--accent-orange);
    font-size: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Component Cards */
.help-component-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.help-component-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
}

.help-comp-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.help-component-card strong {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.help-component-card p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 6px;
}

.help-component-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-component-card li {
    font-size: 11px;
    color: var(--text-muted);
    padding: 3px 0;
    padding-left: 14px;
    position: relative;
    line-height: 1.4;
}

.help-component-card li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: bold;
    font-size: 14px;
}

.help-component-card li strong {
    font-size: 11px;
    display: inline;
    color: var(--accent-green);
}

/* Demo Scenarios */
.help-demo-scenario {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 12px;
}

.help-demo-scenario h5 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-demo-scenario > p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.help-demo-scenario ol {
    padding-left: 20px;
    margin: 0;
}

.help-demo-scenario li {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 2px 0;
}

.help-demo-scenario li strong {
    color: var(--text-main);
}

.demo-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.demo-badge.blue { background: rgba(0, 242, 254, 0.15); color: var(--accent-blue); }
.demo-badge.orange { background: rgba(255, 145, 0, 0.15); color: var(--accent-orange); }
.demo-badge.green { background: rgba(56, 239, 125, 0.15); color: var(--accent-green); }
.demo-badge.red { background: rgba(255, 23, 68, 0.15); color: var(--accent-red); }

.text-red { color: var(--accent-red); }
.text-green { color: var(--accent-green); }

/* Alert Sections */
.help-section {
    margin-bottom: 18px;
}

.help-section h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
    border-left: 2px solid var(--accent-blue);
    padding-left: 8px;
}

.help-section ol {
    padding-left: 20px;
}

.help-section li {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 2px 0;
}

.help-section li strong {
    color: var(--text-main);
}

/* Channel Grid */
.help-channels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.help-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.help-channel:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
}

.help-channel i {
    font-size: 20px;
    color: var(--accent-blue);
}

.help-channel span {
    font-size: 13px;
    font-weight: 600;
}

.help-channel small {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Config Table */
.help-config-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.help-config-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.help-config-row span:last-child {
    font-size: 12px;
    color: var(--text-muted);
}

/* -------------------------------------------------------------
   Keyframe Animations
------------------------------------------------------------- */
@keyframes pulseGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 242, 254, 0.3), 0 0 20px rgba(0, 242, 254, 0.1);
        opacity: 0.8;
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 242, 254, 0.6), 0 0 35px rgba(0, 242, 254, 0.3);
        opacity: 1;
    }
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes databasePulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.2); }
}

@keyframes pulseRing {
    0% { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1.15); opacity: 0; }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

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

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

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

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

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive adjustments for laptop screens */
@media (max-height: 900px) {
    .app-container {
        padding: 6px;
        gap: 6px;
    }
    .app-header {
        height: 48px;
        padding: 6px 14px;
    }
    .logo-icon {
        font-size: 22px;
    }
    .brand-karoona, .brand-x {
        font-size: 17px;
    }
    .tagline {
        display: none;
    }
    .panel-header {
        padding: 8px 14px;
    }
    .panel-header h2 {
        font-size: 14px;
    }
    .bottom-panel {
        height: 200px;
    }
    .bottom-panel .panel-header {
        padding: 6px 14px;
    }
    .bottom-panel .panel-header h2 {
        font-size: 13px;
    }
    .sim-action-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
    .simulation-workspace {
        padding: 2px 6px;
    }
}

@media (max-height: 750px) {
    .app-header {
        height: 42px;
        padding: 4px 12px;
    }
    .logo-icon {
        font-size: 20px;
    }
    .brand-karoona, .brand-x {
        font-size: 16px;
    }
    .status-indicator {
        padding: 4px 8px;
        font-size: 11px;
    }
    .bottom-panel {
        height: 180px;
    }
    .bottom-panel .panel-header {
        padding: 4px 10px;
    }
}

