/* premium-glassmorphism.css - Lead Dashboard Styles */

:root {
    --bg-dark: #090d16;
    --bg-card: rgba(22, 33, 62, 0.45);
    --bg-card-hover: rgba(22, 33, 62, 0.65);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-color-focus: rgba(81, 107, 235, 0.4);
    
    --primary: #516beb;
    --primary-hover: #3b55d1;
    --accent: #e94560;
    --success: #2ecc71;
    --warning: #f1c40f;
    --error: #e74c3c;
    
    --text-main: #f5f6fa;
    --text-muted: #8b9bb4;
    --text-dark: #1e272e;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 20%, rgba(81, 107, 235, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(233, 69, 96, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s ease;
}

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

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

/* Sidebar */
.sidebar {
    background: rgba(13, 19, 33, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    width: 260px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    font-size: 28px;
    color: var(--primary);
}

.sidebar-header h1 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-header span {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: all 0.2s ease;
}

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

.nav-item.active {
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(81, 107, 235, 0.4);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info i {
    font-size: 24px;
    color: var(--text-muted);
}

.user-info span {
    font-weight: 600;
    display: block;
}

.user-info small {
    color: var(--text-muted);
    font-size: 11px;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    color: var(--accent);
    background: rgba(233, 69, 96, 0.1);
}

/* Content Area */
.content-area {
    flex-grow: 1;
    padding: 32px;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-title h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-title p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Tab panes */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border: none;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 15px rgba(81, 107, 235, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

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

.btn-scan {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(81, 107, 235, 0.25);
    transition: all 0.3s ease;
}

.btn-scan:hover {
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.4);
    transform: scale(1.02);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.icon-blue {
    background: rgba(81, 107, 235, 0.15);
    color: var(--primary);
}

.icon-green {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
}

.icon-purple {
    background: rgba(155, 89, 182, 0.15);
    color: #9b59b6;
}

.kpi-info h3 {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

.kpi-info span {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    display: block;
}

/* Tables */
.table-container {
    padding: 24px;
    margin-bottom: 32px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

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

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.priority-high {
    color: var(--accent);
    font-weight: 600;
}

.priority-sredni {
    color: var(--warning);
    font-weight: 600;
}

.priority-niski {
    color: var(--text-muted);
}

.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

input[type="text"], input[type="password"], input[type="number"], select, textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-body);
    padding: 12px 16px;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--border-color-focus);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-subheader {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 16px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    color: var(--primary);
}

/* Login Box */
.login-box {
    width: 400px;
    padding: 40px;
    margin: 10vh auto;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.login-header h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}

.login-header p {
    color: var(--text-muted);
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 13px;
}

.alert-error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid var(--error);
    color: #ff6b6b;
}

.alert-success {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid var(--success);
    color: #2ecc71;
}

/* Sandbox Layout */
.sandbox-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

.sandbox-column {
    padding: 24px;
}

.sandbox-output-panel {
    display: flex;
    flex-direction: column;
}

.sandbox-output-wrapper {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 520px;
}

.output-pre {
    color: #2ecc71;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
}

/* Accounts Grid & Card */
.section-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.account-card {
    padding: 24px;
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.account-card-header h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
}

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

.badge-active {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
}

.badge-inactive {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.account-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 4px;
}

.detail-row span:first-child {
    color: var(--text-muted);
}

.account-card-actions {
    display: flex;
    gap: 10px;
}

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

.modal-content {
    width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
}

#account-modal .modal-content {
    width: 1050px;
    max-width: 95vw;
}

.modal-body-layout {
    display: flex;
    gap: 32px;
    margin-bottom: 20px;
}

.modal-left-col {
    flex: 1;
    min-width: 0;
}

.modal-right-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.prompt-group {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
}

.prompt-group label {
    margin-bottom: 8px;
}

.prompt-group textarea {
    flex: 1;
    min-height: 400px;
    resize: none;
    height: 100%;
}

.form-group.flex-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 36px;
}

.form-group.flex-row label {
    margin-bottom: 0;
}

.form-group.flex-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Helpers */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-zoom {
    animation: zoomIn 0.3s ease;
}

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

.animate-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animate-shimmer {
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
}

.toast {
    background: rgba(22, 33, 62, 0.95);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    animation: slideIn 0.3s ease-out;
}

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

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--error); }
.toast-warning { border-left-color: var(--warning); }

/* System Status Indicators (Notification Gate) */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-green {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: statusPulse 2s infinite;
}

select {
    background-color: #121b2d !important;
    color: var(--text-main) !important;
    cursor: pointer;
}
select option {
    background-color: #16213e !important;
    color: #f5f6fa !important;
    padding: 8px;
}

.dot-red {
    background-color: var(--error);
    box-shadow: 0 0 8px var(--error);
    animation: statusPulse 1s infinite;
}

@keyframes statusPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Timeline Activity Chart */
.timeline-chart-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 8px;
}

.timeline-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timeline-date {
    width: 100px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

.timeline-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.timeline-bar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-bar {
    height: 12px;
    border-radius: 6px;
    transition: width 0.5s ease-in-out;
}

.bar-scans {
    background: linear-gradient(90deg, var(--primary), #7085f5);
    box-shadow: 0 0 6px rgba(81, 107, 235, 0.3);
}

.bar-leads {
    background: linear-gradient(90deg, var(--success), #58d68d);
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.3);
}

.bar-val {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    width: 24px;
}

@media (max-width: 1024px) {
    .modal-body-layout {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* --- Sandbox Debug Terminal --- */
.sandbox-debug-terminal {
    margin-top: 20px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
    font-family: monospace;
}

.debug-terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid #30363d;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.debug-terminal-header h4 {
    margin: 0;
    color: #58a6ff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.debug-metrics-badge {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #8b949e;
    background: #161b22;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #30363d;
}

.debug-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.debug-tab-btn {
    background: #161b22;
    color: #8b949e;
    border: 1px solid #30363d;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.debug-tab-btn:hover {
    background: #21262d;
    color: #c9d1d9;
}

.debug-tab-btn.active {
    background: #238636;
    color: #ffffff;
    border-color: #2ea043;
}

.debug-content-wrapper {
    background: #090d13;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 12px;
    max-height: 350px;
    overflow-y: auto;
}

.debug-content-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: #e6edf3;
    font-size: 12px;
    font-family: monospace;
}

/* Range Selector Buttons for Analytics Chart */
.btn-range {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-range.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(81, 107, 235, 0.4);
}

