:root {
    --bg-dark: #05050a;
    --text-main: #f0f0f5;
    --text-muted: #a0a0b0;
    --glass-bg: rgba(20, 20, 30, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #5e6ad2;
    --accent-glow: rgba(94, 106, 210, 0.4);
    --success: #38ef7d;
    --warning: #f7b733;
    --radius-lg: 24px;
    --radius-md: 16px;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
#particle-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 50%, rgba(94, 106, 210, 0.15), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(43, 88, 118, 0.15), transparent 40%);
    z-index: -2;
}

.glass-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(80px);
    -webkit-backdrop-filter: blur(80px);
    z-index: -1;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 10, 0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), #2b5876);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 32px var(--accent-glow);
}

.brand-text h1 {
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    margin-bottom: 0.2rem;
}

.brand-text .subdomain {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.35rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.view-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.view-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.spark-btn {
    background: linear-gradient(135deg, #8A2387, #E94057);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 64, 87, 0.3);
}

.spark-btn:hover {
    background: linear-gradient(135deg, #9b2898, #ff4c62);
    box-shadow: 0 6px 20px rgba(233, 64, 87, 0.5);
    transform: translateY(-1px);
}

.spark-btn.active {
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
    transform: translateY(1px);
}

/* Main Content Area */
.content-area {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 4rem;
}

.page-header {
    margin-bottom: 3rem;
}

.page-header h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #a0a0b0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    line-height: 1.6;
}

/* Stats */
.stats-bar {
    display: flex;
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-chip {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.stat-chip i {
    color: var(--accent);
    font-size: 1.2rem;
}

/* Filters */
.filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 2rem;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.8rem 1rem 0.8rem 3rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.category-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-main);
}

.filter-btn.active {
    background: var(--text-main);
    color: var(--bg-dark);
    border-color: var(--text-main);
    font-weight: 500;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Gallery List */
.gallery-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Project Card */
.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, var(--glass-bg), transparent);
    z-index: 5;
}

.project-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
}

.project-card:hover .project-thumbnail {
    transform: scale(1.05);
}

.project-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.9);
    z-index: 10;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover .project-icon {
    transform: scale(1.1);
}

.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.status-live {
    background: rgba(56, 239, 125, 0.2);
    color: var(--success);
    border: 1px solid rgba(56, 239, 125, 0.3);
}

.status-development {
    background: rgba(247, 183, 51, 0.2);
    color: var(--warning);
    border: 1px solid rgba(247, 183, 51, 0.3);
}

.status-configured {
    background: rgba(94, 106, 210, 0.2);
    color: var(--accent);
    border: 1px solid rgba(94, 106, 210, 0.3);
}

.status-not-started {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex: 1;
}

.tech-stack {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #c0c0d0;
    border: 1px solid var(--glass-border);
}

.card-links {
    display: flex;
    gap: 0.75rem;
}

.card-btn {
    flex: 1;
    padding: 0.7rem;
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-primary:hover {
    background: var(--text-main);
    color: var(--bg-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
}

.btn-secondary:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* List View Overrides */
.list-view .project-card {
    flex-direction: row;
    height: 140px;
}

.list-view .card-header {
    width: 200px;
    height: 100%;
}

.list-view .card-header::after {
    background: linear-gradient(to right, transparent, var(--glass-bg));
    width: 50%;
    height: 100%;
    left: auto;
    right: 0;
}

.list-view .card-body {
    flex-direction: row;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
}

.list-view .card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.list-view .card-category {
    margin-bottom: 0.2rem;
}

.list-view .card-title {
    margin-bottom: 0.3rem;
}

.list-view .card-desc {
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-view .tech-stack {
    margin-bottom: 0;
    width: 150px;
}

.list-view .card-links {
    flex-direction: column;
    width: 160px;
}

.list-view .status-badge {
    position: static;
    margin-left: 1rem;
}

/* 3D Container */
#three-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    background: #000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#three-container.hidden {
    opacity: 0;
    pointer-events: none;
}

#three-canvas-target {
    width: 100%;
    height: 100%;
}

.exit-3d {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    backdrop-filter: blur(10px);
    z-index: 510;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exit-3d:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.glass-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 30, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2.5rem;
    border-radius: var(--radius-lg);
    color: white;
    font-weight: 500;
    letter-spacing: 1px;
    z-index: 505;
}

.floating-panel {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: white;
    z-index: 510;
    min-width: 300px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
}

/* Helpers */
.hidden {
    display: none !important;
}

@media (max-width: 1024px) {
    .content-area {
        padding: 2rem;
    }

    .list-view .project-card {
        flex-direction: column;
        height: auto;
    }

    .list-view .card-header {
        width: 100%;
        height: 120px;
    }

    .list-view .card-header::after {
        background: linear-gradient(to top, var(--glass-bg), transparent);
        width: 100%;
        height: 50%;
        bottom: 0;
    }

    .list-view .card-body {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .list-view .card-links,
    .list-view .tech-stack {
        width: 100%;
        flex-direction: row;
    }
}