/* Projects Page Styles */

/* Particle Network Background */
#particle-network {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

/* Command Palette */
.command-palette {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.command-palette.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.command-input {
    width: 100%;
    padding: 20px;
    font-size: 1.1rem;
    background: transparent;
    border: none;
    color: white;
    outline: none;
    font-family: 'Fira Code', monospace;
}

.command-results {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.projects-hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 120px 20px 80px;
    position: relative;
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.1;
}

.title-word {
    display: inline-block;
    animation: slideInWord 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.title-word:nth-child(2) {
    animation-delay: 0.1s;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes slideInWord {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    text-align: center;
    opacity: 0;
    animation: fadeIn 0.8s 0.3s forwards;
}

.metric-highlight {
    color: var(--accent-color);
    font-weight: 600;
    font-family: 'Fira Code', monospace;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.8s 0.5s forwards;
}

.filter-btn {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0;
    animation: fadeIn 1s 0.8s forwards;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    margin: 10px auto;
    border-right: 2px solid var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: rotate(45deg) translateY(0);
    }
    40% {
        transform: rotate(45deg) translateY(-10px);
    }
    60% {
        transform: rotate(45deg) translateY(-5px);
    }
}

/* Projects Section */
.projects-section {
    padding: 80px 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Projects Grid - Bento Layout */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    grid-auto-rows: 400px;
}

/* Project Cards */
.project-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    transform-style: preserve-3d;
    animation: cardEntry 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.project-card.large {
    grid-column: span 2;
    grid-row: span 1;
}

.project-card.medium {
    grid-column: span 1;
    grid-row: span 1;
}

.project-card.standard {
    grid-column: span 1;
    grid-row: span 1;
}

@keyframes cardEntry {
    from {
        opacity: 0;
        transform: translateY(30px) rotateX(-5deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px -12px rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Card Background Effects */
.card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    z-index: 1;
}

.neural-network,
.database-constellation,
.transformer-architecture,
.feature-matching,
.ensemble-viz,
.pathfinding-viz {
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0.1;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

/* Card Content */
.card-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.project-metric {
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Fira Code', monospace;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.tech-badge {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.project-card:hover .tech-badge {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-color);
}

/* Card Metrics */
.card-metrics {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    font-family: 'Fira Code', monospace;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 10px;
}

.explore-btn {
    flex: 1;
    padding: 12px 24px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.explore-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.explore-btn:hover::before {
    width: 300px;
    height: 300px;
}

.explore-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

/* Expanded Content */
.card-expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: none;
    padding: 80px 20px;
    overflow-y: auto;
}

.card-expanded.active {
    display: block;
    animation: expandIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes expandIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.expanded-content {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 40px;
}

/* Metrics Dashboard */
.metrics-dashboard {
    padding: 80px 20px;
    background: rgba(0, 0, 0, 0.03);
}

.dashboard-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    color: var(--text-primary);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.metric-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-chart {
    width: 100%;
    height: 200px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-card.large {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .filter-btn {
        width: 100%;
    }
    
    .projects-grid {
        gap: 20px;
        grid-auto-rows: auto;
    }
    
    .card-metrics {
        flex-direction: column;
        gap: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Filter Effects */
.project-card.filtered-out {
    opacity: 0.2;
    transform: scale(0.95);
    pointer-events: none;
}

.project-card.filtered-out:hover {
    transform: scale(0.95);
}

/* Dark Theme Adjustments */
[data-theme="dark"] .project-card {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .filter-btn {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .command-palette {
    background: rgba(20, 20, 20, 0.98);
}