:root {
    --bg-darker: #07101a;
    --bg-dark: #0b1320;
    --card-bg: rgba(6, 11, 16, 0.72);
    --glass: rgba(9, 14, 20, 0.65);
    --neon: #00ff88;
    --neon-2: #00d4ff;
    --accent: #8b5cf6;
    --muted: #98a4b2;
    --text: #e6eef8;
    --glass-border: rgba(0, 255, 136, 0.14);
}

/* ========== PARTICLES BACKGROUND ========== */
@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -10px) rotate(90deg); }
    50% { transform: translate(-5px, 5px) rotate(180deg); }
    75% { transform: translate(-10px, -15px) rotate(270deg); }
}

@keyframes float-alt {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, 20px) scale(1.1); }
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 255, 136, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: pulse-bg 8s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Floating geometric shapes */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(0, 255, 136, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(0, 212, 255, 0.3), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 40% 80%, rgba(139, 92, 246, 0.3), transparent);
    background-size: 200px 200px, 300px 300px, 150px 150px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px;
    pointer-events: none;
    z-index: 0;
    animation: float 20s linear infinite;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', sans-serif
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    background: linear-gradient(180deg, #05121a 0%, #07101a 60%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container for page content */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Top bar styles */
.topbar {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--glass);
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 255, 136, 0.03) inset;
    backdrop-filter: blur(8px);
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.topbar:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 255, 136, 0.15), 0 0 25px rgba(0, 255, 136, 0.05) inset;
}

.logo {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--neon), var(--neon-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #052423;
    font-size: 18px;
    box-shadow: 0 0 18px rgba(0, 255, 136, 0.18);
    animation: logoBreath 3s ease-in-out infinite, logoRotate 20s linear infinite;
    position: relative;
}

.logo::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    padding: 2px;
    background: linear-gradient(45deg, var(--neon), var(--neon-2), var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    animation: borderPulse 3s ease-in-out infinite;
}

.top-title {
    display: flex;
    flex-direction: column;
}

.top-title .title-main {
    font-weight: 700;
    font-size: 20px;
    color: var(--text);
}

.top-title .title-sub {
    font-size: 14px;
    color: var(--muted);
    margin-top: 2px;
}

/* Top actions */
.top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 30px;
}

/* Card styles */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.section {
    margin-bottom: 40px;
}

.section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon);
    margin-bottom: 10px;
}

/* Stats cards */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(2, 6, 10, 0.6);
    text-align: center;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--neon);
    margin-bottom: 8px;
}

.stat-card .label {
    font-size: 1rem;
    color: var(--muted);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon), var(--neon-2));
    color: #051219;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.4);
}

.btn-delete {
    background: rgba(255, 70, 102, 0.15);
    color: #ff4466;
    border: 1px solid rgba(255, 70, 102, 0.3);
}

.btn-delete:hover {
    background: rgba(255, 70, 102, 0.25);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.25);
    transform: translateY(-1px);
}

.action-btn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    text-decoration: none;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: rgba(0, 255, 136, 0.15);
    transform: translateY(-1px);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--neon), var(--neon-2));
    color: #051219;
    font-weight: 700;
    box-shadow: 0 6px 30px rgba(0, 255, 136, 0.12), 0 0 30px rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 255, 136, 0.08);
}

.action-btn:hover {
    border-color: rgba(0, 255, 136, 0.15);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--neon), var(--neon-2));
    color: #051219;
    font-weight: 700;
    box-shadow: 0 6px 30px rgba(0, 255, 136, 0.12), 0 0 30px rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 255, 136, 0.08);
}

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

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(6, 11, 16, 0.5);
    border: 1px solid rgba(0, 255, 136, 0.15);
    color: var(--text);
    transition: all 0.3s ease;
    font-size: 14px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--neon);
    background: rgba(6, 11, 16, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-select {
    background-color: rgba(6, 11, 16, 0.8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300ff88' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 40px;
}

.form-select option {
    background-color: #0b1320;
    color: var(--text);
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text);
}

table td {
    color: var(--muted);
}

table tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* File list specific styles */
.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon {
    font-size: 24px;
}

.file-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.upload-date {
    font-size: 12px;
    color: var(--muted);
}

.file-format {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.file-size {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.action-cell {
    text-align: center;
}

/* Search box */
.search-box {
    margin-bottom: 30px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 16px;
    backdrop-filter: blur(10px);
}

.search-input:focus {
    outline: none;
    border-color: var(--neon);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

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

/* Scenario cards */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.scenario-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(2, 6, 10, 0.6);
    transition: transform 0.3s ease;
}

.scenario-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(2, 6, 10, 0.8);
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.scenario-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.scenario-status {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: rgba(0, 255, 136, 0.1);
    color: var(--neon);
}

.status-inactive {
    background: rgba(255, 70, 102, 0.1);
    color: #ff4466;
}

.scenario-description {
    color: var(--muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.scenario-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 16px;
}

.scenario-actions {
    display: flex;
    gap: 8px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--muted);
    margin-bottom: 20px;
}

/* Alert styles */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border-left-color: var(--neon);
    color: var(--neon);
}

.alert-error {
    background: rgba(255, 70, 102, 0.1);
    border-left-color: #ff4466;
    color: #ff4466;
}

/* Upload link */
.upload-link {
    display: inline-block;
    background: linear-gradient(135deg, var(--neon), var(--neon-2));
    color: #051219;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.upload-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.4);
}

/* No files message */
.no-files {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

/* Chat styles */
.chat-box {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.message.user {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.2);
    margin-left: 20%;
}

.message.bot {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    margin-right: 20%;
}

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

.form-box .form-input {
    flex: 1;
}

.form-box .btn {
    flex-shrink: 0;
}

/* Brand section */
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

/* CTA section */
.cta-section {
    text-align: center;
    margin: 60px 0;
}

.cta-section h2 {
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 16px;
}

.cta-section p {
    font-size: 1.1rem;
    color: var(--muted);
    margin-bottom: 30px;
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid var(--glass-border);
}

.footer p {
    color: var(--muted);
    margin: 5px 0;
}

/* Animations */
@keyframes logoBreath {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 18px rgba(0, 255, 136, 0.18);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.4), 0 0 50px rgba(0, 212, 255, 0.2);
    }
}

@keyframes logoRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes borderPulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.6; }
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.4), rgba(0, 212, 255, 0.3));
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.6), rgba(0, 212, 255, 0.5));
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 136, 0.4) rgba(255, 255, 255, 0.02);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 30px 15px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .logo-box {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }

    .header-text h1 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .scenario-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    table {
        font-size: 14px;
    }

    table th, table td {
        padding: 8px 12px;
    }
}