/* Base setup for dark background + no horizontal scroll */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
    background-color: #0f172a;
    color: white;
    font-family: 'Inter', sans-serif;
}

/* Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #334155;
    border-top: 4px solid #06b6d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Theme variables */
:root {
    --primary: #06b6d4; /* Cyan 500 */
    --secondary: #6366f1; /* Indigo 500 */
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* 3D Canvas */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* UI layer */
#ui-layer {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Glassmorphism panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* View container & transitions */
.view-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hidden-view {
    display: none;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
}

.visible-view {
    opacity: 1;
    transform: scale(1) translateY(0);
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Project cards grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
    width: 100%;
    perspective: 1000px; /* for 3D tilt */
}

@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card-wrapper {
    position: relative;
    height: 100%;
    transform-style: preserve-3d;
}

.project-card {
    height: 100%;
    padding: 2rem;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
}

/* Card hover */
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 1rem;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), transparent, var(--secondary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 1;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: #0f172a;
    font-weight: 600;
    padding: 1rem 2.5rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    /*color: var(--primary);*/
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: white;
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.8, 0, 0.2, 1);
}

.btn-primary:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.btn-back {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: rgba(255,255,255,0.6);
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.btn-back:hover {
    color: white;
    border-color: white;
    background: rgba(255,255,255,0.1);
}

/* Modules list style – Explorer-like but on-theme */
.module-list {
    max-width: 900px;
    width: 100%;
}

.module-row {
    padding: 0.9rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.module-row-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.module-row-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.module-row-icon {
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.1);
}

.module-row-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e5e7eb;
}

.module-row-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
}

.module-row-version {
    font-size: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Hover effects */
.module-row:hover {
    background: rgba(148, 163, 184, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.8);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.07); /* ~70% transparent feeling */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);

    color: #e2e8f0; /* slate-200 */
    font-weight: 600;

    padding: 1rem 2.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;

    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    transition: all 0.3s ease;
}

/* Hover effect */
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.12);
}

