:root {
    --bg-dark: #07080b;
    --sidebar-bg: rgba(13, 15, 23, 0.85);
    --glass-bg: rgba(20, 22, 37, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #e2e8f0;
    --text-muted: #64748b;
    --accent-1: #ff2a85; /* Cyber pink */
    --accent-2: #8a2be2; /* Deep purple */
    --accent-3: #00f0ff; /* Neon cyan */
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow: hidden; /* Prevent body scroll, layout handles it */
    position: relative;
    line-height: 1.6;
}

/* Background Effects */
.scanlines {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1));
    background-size: 100% 4px; z-index: 100; pointer-events: none; opacity: 0.3;
}
.orb {
    position: fixed; border-radius: 50%; filter: blur(120px); z-index: 0; opacity: 0.6;
    animation: float 25s infinite ease-in-out alternate;
}
.orb-1 { width: 500px; height: 500px; background: var(--accent-1); top: -200px; left: -100px; }
.orb-2 { width: 600px; height: 600px; background: var(--accent-2); bottom: -250px; right: 10%; animation-delay: -5s; }
.orb-3 { width: 400px; height: 400px; background: var(--accent-3); top: 30%; left: 40%; animation-delay: -10s; opacity: 0.4; mix-blend-mode: screen; }

@keyframes float { 0% { transform: translate(0, 0); } 100% { transform: translate(100px, 100px) scale(1.1); } }

/* App Layout */
.app-layout {
    display: flex; height: 100vh; width: 100vw; position: relative; z-index: 10;
}

/* Sidebar */
.sidebar {
    width: 250px; background: var(--sidebar-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border); display: flex; flex-direction: column;
    padding: 30px 0; box-shadow: 5px 0 30px rgba(0,0,0,0.5);
}

.sidebar-header {
    padding: 0 25px; margin-bottom: 40px; display: flex; align-items: center; justify-content: space-between;
}
.sidebar-header h2 {
    font-family: var(--font-mono); font-size: 1.5rem; color: #fff; text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}
.status-dot {
    width: 10px; height: 10px; border-radius: 50%; background: #00ff88; box-shadow: 0 0 10px #00ff88;
    animation: blink 2s infinite ease-in-out;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.nav-links { list-style: none; display: flex; flex-direction: column; gap: 10px; padding: 0 15px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px; border-radius: 12px;
    font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-muted);
    cursor: pointer; transition: all 0.3s ease; position: relative;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.nav-item.active {
    color: #fff; background: linear-gradient(90deg, rgba(255, 42, 133, 0.15), transparent);
    border-left: 3px solid var(--accent-1); border-radius: 4px 12px 12px 4px;
}

.sidebar-footer {
    margin-top: auto; padding: 0 25px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted);
}

/* Main Content Area */
.content-area {
    flex: 1; overflow-y: auto; padding: 50px; scroll-behavior: smooth;
    /* Custom Scrollbar for Chrome/Safari */
}
.content-area::-webkit-scrollbar { width: 8px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.content-area::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Tabs */
.tab-content { display: none; animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

header { margin-bottom: 30px; }
.page-title {
    font-family: var(--font-mono); font-size: 2.2rem; font-weight: 700; color: #fff;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.3); margin-bottom: 5px;
}
.cursor { animation: cursorBlink 1s step-end infinite; color: var(--accent-1); }
@keyframes cursorBlink { 50% { opacity: 0; } }
.subtitle { font-family: var(--font-mono); font-size: 0.95rem; color: var(--accent-3); opacity: 0.8; }

/* Entry Box */
.entry-box {
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: 20px; padding: 24px; margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
textarea {
    width: 100%; height: 160px; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px; padding: 18px; font-family: var(--font-sans); font-size: 1.05rem; color: #fff;
    resize: none; transition: all 0.3s ease; line-height: 1.5;
}
textarea:focus { outline: none; border-color: var(--accent-1); box-shadow: 0 0 20px rgba(255, 42, 133, 0.2); }
textarea::placeholder { color: rgba(255, 255, 255, 0.25); font-family: var(--font-mono); }

.controls { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.input-group { display: flex; gap: 15px; align-items: center; }

.sleek-select {
    appearance: none; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px; padding: 12px 40px 12px 16px; color: #fff; font-family: var(--font-sans); font-size: 0.95rem; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
    transition: all 0.3s ease;
}
.sleek-select:focus { border-color: var(--accent-3); box-shadow: 0 0 15px rgba(0, 240, 255, 0.2); }
.sleek-select option { background: #0a0b10; color: #fff; }

.file-upload {
    position: relative; overflow: hidden; display: inline-block; cursor: pointer; background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15); padding: 12px 20px; border-radius: 10px; font-size: 0.9rem;
    transition: all 0.3s ease; color: var(--text-muted); font-family: var(--font-mono);
}
.file-upload:hover { border-color: var(--accent-3); color: #fff; background: rgba(0, 240, 255, 0.05); }
.file-upload input[type="file"] { position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; height: 100%; width: 100%; }

.primary-btn {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); color: white; border: none;
    padding: 14px 28px; border-radius: 10px; font-family: var(--font-mono); font-size: 0.95rem; font-weight: 700;
    cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(255, 42, 133, 0.3); display: flex; align-items: center; gap: 8px;
}
.primary-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 25px rgba(255, 42, 133, 0.5); }
.primary-btn:active { transform: translateY(0); }

/* Logs Grid */
.logs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.section-title { font-family: var(--font-mono); font-size: 1.2rem; color: var(--text-muted); margin-bottom: 20px; }

.entry-card {
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px; display: flex; flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); transition: transform 0.3s ease, border-color 0.3s ease; position: relative;
    overflow: hidden;
}
.entry-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
    background: linear-gradient(to bottom, var(--accent-3), var(--accent-1)); opacity: 0.5; transition: opacity 0.3s ease;
}
.entry-card:hover { transform: translateY(-5px); border-color: rgba(0, 240, 255, 0.3); }
.entry-card:hover::before { opacity: 1; }

.entry-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.badge { background: rgba(0,0,0,0.4); padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.05); font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-3); }

.entry-text { font-size: 1rem; line-height: 1.6; white-space: pre-wrap; flex-grow: 1; margin-bottom: 15px; }
.entry-img { width: 100%; height: auto; max-height: 200px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); margin-top: auto; }

.delete-btn {
    align-self: flex-end; margin-top: 15px; background: transparent; color: var(--text-muted); border: 1px solid rgba(255,255,255,0.1);
    padding: 6px 12px; border-radius: 6px; font-family: var(--font-mono); font-size: 0.75rem; cursor: pointer; transition: all 0.3s ease;
}
.delete-btn:hover { background: rgba(255, 42, 42, 0.1); color: #ff4a4a; border-color: #ff4a4a; }

/* Analytics Canvas */
.analytics-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 20px; padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.canvas-container { width: 100%; max-width: 800px; margin: 0 auto; height: 350px; position: relative; }
canvas { width: 100% !important; height: 100% !important; filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.4)); }

.stats-row { display: flex; justify-content: center; gap: 40px; margin-top: 30px; }
.stat-box { text-align: center; background: rgba(0,0,0,0.3); padding: 20px 30px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); }
.stat-box h2 { font-size: 2.5rem; color: var(--accent-1); font-family: var(--font-mono); margin-bottom: 5px; text-shadow: 0 0 15px rgba(255, 42, 133, 0.4); }
.stat-box span { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Audio Container */
.audio-container {
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 20px; padding: 30px;
    display: flex; flex-direction: column; align-items: center; gap: 30px; max-width: 700px; margin: 0 auto;
}
.vinyl-record {
    width: 150px; height: 150px; border-radius: 50%; background: #111; border: 4px solid #222;
    position: relative; box-shadow: 0 0 30px rgba(0,0,0,0.8), inset 0 0 10px #000;
    background-image: repeating-radial-gradient(#111, #111 2px, #1a1a1a 3px, #1a1a1a 4px);
    animation: spin 4s linear infinite;
}
.vinyl-record::after {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 50px; height: 50px; background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); border-radius: 50%;
}
.vinyl-record::before {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 10px; height: 10px; background: #000; border-radius: 50%; z-index: 2; border: 2px solid #333;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.embed-wrapper { width: 100%; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

/* Responsive */
@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 15px 20px; box-shadow: 0 5px 20px rgba(0,0,0,0.4); border-right: none; border-bottom: 1px solid var(--glass-border); z-index: 100; }
    .sidebar-header { margin-bottom: 0; padding: 0; }
    .sidebar-header h2 { font-size: 1.2rem; }
    .nav-links { flex-direction: row; flex: 1; justify-content: center; padding: 0; }
    .nav-item { padding: 8px 12px; }
    .nav-item span { display: none; } /* Show icons only on mobile */
    .sidebar-footer { display: none; }
    .content-area { padding: 25px; }
    .controls { flex-direction: column; align-items: stretch; }
    .input-group { flex-direction: column; align-items: stretch; }
    .primary-btn { justify-content: center; }
}