:root {
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Glassmorphism utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.sidebar {
    width: 260px;
    padding: 2rem;
    margin: 1rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 1rem;
    height: calc(100vh - 2rem);
}

.logo {
    margin-bottom: 3rem;
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--accent);
}

.logo p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li {
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    color: var(--text-muted);
    font-weight: 600;
}

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

.nav-links li.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

.topbar {
    margin-bottom: 3rem;
}

.topbar h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.topbar p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Views */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view-section.active {
    display: block;
}

/* Grid layout for Dashboard */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card h3 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    min-height: 40px;
}

.img-container {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: zoom-in;
}

.img-container::after {
    content: 'Click to enlarge';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.7);
    color: white;
    text-align: center;
    padding: 8px 0;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.img-container:hover::after {
    opacity: 1;
}

.img-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

/* Code View */
.code-card {
    padding: 2rem;
    width: 100%;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-download {
    background: var(--accent);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.btn-download:hover {
    background: var(--accent-hover);
}

pre {
    border-radius: 12px !important;
    max-height: 70vh;
}

/* Modal (Lightbox) */
.modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    padding-top: 60px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(15, 23, 42, 0.95); 
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 1200px;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1000px;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    height: 150px;
    font-size: 1.2rem;
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--accent-hover);
    text-decoration: none;
    cursor: pointer;
}

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

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

.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
    animation-delay: var(--delay);
}
