/* 
 * DerinCall - CYBERPUNK OVERHAUL
 * Aesthetic: Neon, Glitch, High-Tech, Dark City
 */

:root {
    /* Cyberpunk Palette */
    --cp-bg-dark: #050510;
    --cp-bg-panel: #0a0a14;
    --cp-neon-pink: #ff00ff;
    --cp-neon-cyan: #00ffff;
    --cp-neon-lime: #ccff00;
    --cp-neon-yellow: #ffff00;
    --cp-text-main: #ffffff;
    --cp-text-dim: #8899a6;

    /* Fonts */
    --font-display: 'Orbitron', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Inter', sans-serif;

    /* Effects */
    --glow-pink: 0 0 10px rgba(255, 0, 255, 0.5), 0 0 20px rgba(255, 0, 255, 0.3);
    --glow-cyan: 0 0 10px rgba(0, 255, 255, 0.5), 0 0 20px rgba(0, 255, 255, 0.3);
    --border-neon: 1px solid rgba(0, 255, 255, 0.3);
    --clip-corner: polygon(0 0,
            100% 0,
            100% calc(100% - 15px),
            calc(100% - 15px) 100%,
            0 100%);
}

/* Base Reset */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--cp-bg-dark);
    color: var(--cp-text-main);
    overflow-x: hidden;
    /* Cyber Grid Background */
    background-image:
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

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

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: var(--cp-neon-cyan);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cp-neon-pink);
}

/* Scanlines & Noise (Aggressive) */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(10, 10, 20, 0.95);
    border-right: 2px solid var(--cp-neon-cyan);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 5px 0 30px rgba(0, 255, 255, 0.1);
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.1), transparent);
    border-bottom: 1px solid var(--cp-neon-cyan);
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--cp-neon-yellow);
    text-shadow: 2px 2px 0px var(--cp-neon-pink);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-section-title {
    padding: 0 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--cp-neon-pink);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-item {
    padding: 0.8rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--cp-text-dim);
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.nav-item:hover {
    background: rgba(255, 0, 255, 0.1);
    color: var(--cp-text-main);
    text-shadow: 0 0 5px var(--cp-neon-pink);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.2), transparent);
    color: var(--cp-neon-cyan);
    border-left-color: var(--cp-neon-cyan);
    box-shadow: inset 10px 0 20px -10px var(--cp-neon-cyan);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1.5rem;
    background: #000;
    border-top: 1px solid var(--cp-neon-cyan);
}

.footer-version {
    font-family: var(--font-mono);
    color: var(--cp-neon-lime);
    font-size: 0.7rem;
}

.footer-info {
    font-size: 0.7rem;
    color: var(--cp-text-dim);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - 280px);
}

.header {
    height: 80px;
    background: rgba(5, 5, 16, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(10px);
}

.header-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--cp-text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.page-content {
    padding: 2rem;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

/* Cyber Cards */
.card {
    background: rgba(15, 15, 25, 0.8);
    border: 1px solid var(--cp-neon-cyan);
    position: relative;
    margin-bottom: 1.5rem;
    /* Angled corner effect using clip-path is tricky with borders, using pseudo-element instead */
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.05);
}

.card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--cp-neon-pink);
    border-left: 2px solid var(--cp-neon-pink);
    z-index: 2;
}

.card::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--cp-neon-pink);
    border-right: 2px solid var(--cp-neon-pink);
    z-index: 2;
}

.card-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.1), transparent);
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--cp-neon-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-body {
    padding: 1.5rem;
}

/* Dashboard Stats */
.dashboard-grid {
    display: grid;
    gap: 1.5rem;
}

.stats-flex {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.stat-widget {
    background: #000;
    border: 1px solid var(--cp-neon-pink);
    padding: 1.5rem;
    position: relative;
    clip-path: var(--clip-corner);
}

.stat-widget:hover {
    box-shadow: var(--glow-pink);
    transform: translateY(-2px);
    transition: all 0.3s;
}

.stat-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--cp-neon-pink);
    text-transform: uppercase;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin: 0.5rem 0;
}

/* Buttons */
.btn {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.8rem 1.5rem;
    border: none;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.2s;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--cp-neon-cyan);
    color: #000;
}

.btn-primary:hover {
    background: #fff;
    box-shadow: var(--glow-cyan);
}

.btn-secondary {
    background: transparent;
    color: var(--cp-neon-cyan);
    border: 1px solid var(--cp-neon-cyan);
}

.btn-secondary:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--cp-text-dim);
    color: var(--cp-text-dim);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: var(--cp-neon-pink);
    color: var(--cp-neon-pink);
    box-shadow: var(--glow-pink);
}

/* Forms */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 1rem;
    background: #000;
    border: 1px solid var(--cp-text-dim);
    color: var(--cp-neon-cyan);
    font-family: var(--font-mono);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--cp-neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.2);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--cp-text-dim);
    text-transform: uppercase;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--cp-neon-yellow);
    border-bottom: 2px solid var(--cp-neon-cyan);
    text-transform: uppercase;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.data-table tr:hover td {
    background: rgba(0, 255, 255, 0.05);
    color: var(--cp-neon-cyan);
}

/* Badges */
.type-badge {
    padding: 0.2rem 0.5rem;
    font-family: var(--font-display);
    font-size: 0.7rem;
    text-transform: uppercase;
    border: 1px solid;
}

.type-badge.dialog {
    color: var(--cp-neon-pink);
    border-color: var(--cp-neon-pink);
    background: rgba(255, 0, 255, 0.1);
}

.type-badge.webtext {
    color: var(--cp-neon-lime);
    border-color: var(--cp-neon-lime);
    background: rgba(204, 255, 0, 0.1);
}

.type-badge.custom {
    color: var(--cp-neon-cyan);
    border-color: var(--cp-neon-cyan);
    background: rgba(0, 255, 255, 0.1);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab {
    background: transparent;
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-display);
    color: var(--cp-text-dim);
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

.tab.active {
    color: var(--cp-neon-cyan);
    border-bottom-color: var(--cp-neon-cyan);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: glitch-anim 0.3s;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #000;
    background-image: radial-gradient(circle at 50% 50%, #1a001a 0%, #000 100%);
}

.login-card {
    background: rgba(10, 10, 10, 0.9);
    border: 2px solid var(--cp-neon-pink);
    padding: 3rem;
    width: 400px;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.2);
    clip-path: var(--clip-corner);
}

.login-logo {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 3px 3px 0 var(--cp-neon-cyan), -3px -3px 0 var(--cp-neon-pink);
    margin-bottom: 1rem;
    letter-spacing: 4px;
}

.login-subtitle {
    font-family: var(--font-mono);
    color: var(--cp-neon-cyan);
    margin-bottom: 2rem;
}

.login-input {
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.login-btn {
    width: 100%;
    margin-top: 1rem;
    background: var(--cp-neon-pink);
    color: #fff;
}

.login-btn:hover {
    background: #fff;
    color: var(--cp-neon-pink);
    box-shadow: var(--glow-pink);
}

.login-error {
    color: var(--cp-neon-pink);
    border: 1px solid var(--cp-neon-pink);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    background: rgba(255, 0, 255, 0.1);
}

/* Utilities */
.text-cyan {
    color: var(--cp-neon-cyan);
}

.text-pink {
    color: var(--cp-neon-pink);
}

.text-lime {
    color: var(--cp-neon-lime);
}

.text-dim {
    color: var(--cp-text-dim);
}

.mb-1 {
    margin-bottom: 1rem;
}

.mt-1-5 {
    margin-top: 1.5rem;
}

.w-150 {
    width: 150px;
}

.w-250 {
    width: 250px;
}

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

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.scrollable-card-body {
    height: 400px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.header-info {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--cp-neon-yellow);
}

.preview-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--cp-neon-cyan);
}

.truncate-text {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-message {
    color: var(--cp-neon-pink);
    text-align: center;
    padding: 2rem;
    font-family: var(--font-mono);
}

.error-state {
    border: 1px solid var(--cp-neon-pink);
    color: var(--cp-neon-pink);
    padding: 1rem;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--cp-neon-cyan);
    border-right-color: var(--cp-neon-pink);
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes glitch-anim {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

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

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

.modal {
    background: #000;
    border: 2px solid var(--cp-neon-cyan);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.2);
    clip-path: var(--clip-corner);
}

.modal-header {
    padding: 1.5rem;
    background: var(--cp-neon-cyan);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #000;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 900;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.code-block {
    background: #111;
    padding: 1rem;
    overflow: auto;
    color: var(--cp-neon-lime);
    border: 1px solid var(--cp-neon-lime);
    font-family: var(--font-mono);
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #000;
    border: 1px solid;
    padding: 1rem 2rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    animation: glitch-anim 0.3s;
}

.toast.success {
    border-color: var(--cp-neon-lime);
    color: var(--cp-neon-lime);
    box-shadow: 0 0 10px var(--cp-neon-lime);
}

.toast.error {
    border-color: var(--cp-neon-pink);
    color: var(--cp-neon-pink);
    box-shadow: 0 0 10px var(--cp-neon-pink);
}

/* Pipeline Status */
.pipeline-status {
    background: #000;
    border: 1px solid var(--cp-neon-cyan);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.pipeline-indicator {
    width: 16px;
    height: 16px;
    background: #333;
    border-radius: 50%;
}

.pipeline-indicator.running {
    background: var(--cp-neon-yellow);
    box-shadow: 0 0 15px var(--cp-neon-yellow);
    animation: pulse 0.5s infinite;
}

.pipeline-progress {
    flex: 1;
    height: 10px;
    background: #222;
    border: 1px solid #444;
}

.pipeline-progress-bar {
    height: 100%;
    background: var(--cp-neon-cyan);
    box-shadow: 0 0 10px var(--cp-neon-cyan);
    transition: width 0.2s;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Wizard Steps */
.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.upload-zone {
    border: 2px dashed var(--cp-neon-cyan);
    padding: 3rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(0, 255, 255, 0.05);
}

.upload-zone:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.step {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--cp-text-dim);
    position: relative;
    z-index: 2;
    background: #000;
    padding: 0 0.5rem;
}

.step.active {
    color: var(--cp-neon-cyan);
    text-shadow: 0 0 5px var(--cp-neon-cyan);
}

.line {
    flex: 1;
    height: 2px;
    background: #333;
    margin: 0 0.5rem;
}

.line.active {
    background: var(--cp-neon-cyan);
    box-shadow: 0 0 5px var(--cp-neon-cyan);
}