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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --bg-dark: #0f172a;
    --bg-light: #1e293b;
    --text-light: #e2e8f0;
    --text-dim: #94a3b8;
    --card-bg: #1e293b;
    --border-color: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
}

.progress-bar {
    width: 300px;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--text-dim);
    font-size: 14px;
}

/* Celebration Overlay */
.celebration-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

#confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.celebration-content {
    text-align: center;
    z-index: 1;
    animation: fadeInScale 1s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.celebration-title {
    font-size: clamp(2rem, 8vw, 4rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.celebration-subtitle {
    font-size: 1.5rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.explore-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.explore-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.6);
}

/* Header */
.main-header {
    padding: 2rem;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-light), var(--bg-dark));
    border-bottom: 1px solid var(--border-color);
}

.main-header h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-summary {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    animation: countUp 2s ease-out;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* Navigation */
.filter-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    flex-wrap: wrap;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.filter-btn {
    padding: 8px 20px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    color: var(--text-light);
    border-color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* View Controls */
.view-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.view-btn {
    padding: 10px 25px;
    background: var(--card-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
}

.view-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Main Content */
.main-content {
    min-height: 60vh;
    padding: 2rem;
}

.view-container {
    display: none;
}

.view-container.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Gallery View */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.project-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(99, 102, 241, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.project-preview {
    height: 200px;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.project-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.project-info {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.project-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-dark);
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Timeline View */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: 0 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    padding: 20px 0;
}

.timeline-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    width: calc(50% - 30px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: auto;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: auto;
}

.timeline-content:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

/* Stats View */
.stats-container {
    max-width: 1200px;
    margin: 0 auto;
}

#project-chart {
    width: 100%;
    max-width: 800px;
    height: 400px;
    margin: 0 auto 3rem;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
}

.tech-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.tech-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.tech-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.tech-count {
    font-size: 2rem;
    color: var(--accent-color);
    font-weight: bold;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.achievement {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
}

.achievement:hover {
    border-color: var(--success-color);
    transform: translateY(-3px);
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 1200px;
    width: 100%;
    height: 90vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--text-dim);
    cursor: pointer;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border-radius: 50%;
}

.close-modal:hover {
    color: var(--text-light);
    background: var(--bg-light);
}

#project-iframe {
    width: 100%;
    flex: 1;
    border-radius: 8px 8px 0 0;
}

.modal-info {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.modal-info h3 {
    margin-bottom: 0.5rem;
}

.project-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: var(--secondary-color);
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 3rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.share-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 10px 25px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .stats-summary {
        gap: 2rem;
    }
    
    .filter-nav {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 6px 15px;
        font-size: 0.8rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-content {
        width: calc(100% - 60px);
        margin-left: 60px !important;
    }
    
    .timeline-dot {
        left: 30px;
    }
    
    .modal-content {
        height: 80vh;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.slide-up {
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}