:root {
    --primary: #8338ec;
    --primary-light: #9b5de5;
    --secondary: #3a86ff;
    --bg-dark: #0f0c29;
    --accent: #ff006e;
    --text-main: #ffffff;
    --text-dim: #b0b0b0;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background: #050505;
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #0a0a1a 100%);
}

.background-animation::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('https://www.transparenttextures.com/patterns/carbon-fibre.png');
    opacity: 0.1;
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.dashboard-container {
    display: flex;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 50px;
    background: linear-gradient(to right, #fff, var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    -webkit-text-fill-color: initial;
    color: var(--secondary);
}

nav {
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 10px 20px rgba(131, 56, 236, 0.3);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #4ade80;
}

.dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
    animation: pulse 2s infinite;
}

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

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

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

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

header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

header p {
    color: var(--text-dim);
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(131, 56, 236, 0.4);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--glass-border);
}

.btn.danger {
    background: rgba(255, 0, 110, 0.1);
    color: #ff006e;
    border: 1px solid rgba(255, 0, 110, 0.2);
}

.btn.danger:hover {
    background: #ff006e;
    color: #fff;
}

.btn.info {
    background: rgba(58, 134, 255, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(58, 134, 255, 0.2);
}

.btn.info:hover {
    background: var(--secondary);
    color: #fff;
}

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

.stat-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.purple {
    background: rgba(131, 56, 236, 0.1);
    color: var(--primary);
}

.stat-icon.blue {
    background: rgba(58, 134, 255, 0.1);
    color: var(--secondary);
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 28px;
    font-weight: 700;
}

/* Table */
.table-container {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 20px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 15px;
}

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

.key-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 8px;
    font-family: monospace;
    color: var(--secondary);
    border: 1px solid var(--glass-border);
}

.status-tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-tag.active {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
}

.status-tag.inactive {
    background: rgba(255, 0, 110, 0.1);
    color: #ff006e;
}

.session-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.session-indicator:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 450px;
    padding: 40px;
    border-radius: 30px;
    background: #1a1a2e;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal h2 {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dim);
    font-size: 14px;
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: #fff;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Utils */
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(131, 56, 236, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

::-webkit-scrollbar {
    width: 6px;
}

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

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

/* File Manager Styles */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(131, 56, 236, 0.05);
    transform: scale(1.01);
}

.drop-zone.drag-over {
    animation: dropPulse 1s ease infinite;
}

@keyframes dropPulse {

    0%,
    100% {
        border-color: var(--primary);
        background: rgba(131, 56, 236, 0.05);
    }

    50% {
        border-color: var(--secondary);
        background: rgba(58, 134, 255, 0.08);
    }
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.file-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fileSlideIn 0.4s ease backwards;
}

.file-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

@keyframes fileSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.file-card .file-icon.txt {
    background: rgba(58, 134, 255, 0.12);
    color: var(--secondary);
}

.file-card .file-icon.json {
    background: rgba(255, 167, 38, 0.12);
    color: #ffa726;
}

.file-card .file-icon.py {
    background: rgba(131, 56, 236, 0.12);
    color: #8338ec;
}

.file-card .file-info {
    flex: 1;
    min-width: 0;
}

.file-card .file-info .file-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.file-card .file-info .file-meta {
    font-size: 12px;
    color: var(--text-dim);
}

.file-card .file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.file-card .file-actions .action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s ease;
}

.action-btn.view {
    background: rgba(58, 134, 255, 0.1);
    color: var(--secondary);
}

.action-btn.view:hover {
    background: var(--secondary);
    color: #fff;
}

.action-btn.download {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
}

.action-btn.download:hover {
    background: #4ade80;
    color: #111;
}

.action-btn.delete {
    background: rgba(255, 0, 110, 0.1);
    color: #ff006e;
}

.action-btn.delete:hover {
    background: #ff006e;
    color: #fff;
}

/* Upload progress toast */
.upload-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 2000;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.upload-toast.success {
    border-left: 3px solid #4ade80;
}

.upload-toast.error {
    border-left: 3px solid #ff006e;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

.file-card-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 14px;
}

/* API Tester Styles */
.endpoint-btn {
    flex: 1;
    justify-content: center;
    transition: all 0.25s ease;
    font-size: 13px;
    padding: 12px 16px;
}

.endpoint-btn.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-tag.success {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.25);
}

.status-tag.error {
    background: rgba(255, 0, 110, 0.12);
    color: #ff006e;
    border: 1px solid rgba(255, 0, 110, 0.25);
}

.status-tag.warning {
    background: rgba(255, 167, 38, 0.12);
    color: #ffa726;
    border: 1px solid rgba(255, 167, 38, 0.25);
}

code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}