/* General Styles */
:root {
    --primary-color: #cb114f;
    --secondary-color: #003ae8;
    --accent-color: #ff4e4e;
    --dark-color: #1a1a2e;
    --light-color: #f4f7fd;
    --success-color: #ff6a13;
    --warning-color: #e60000;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.048);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.582);
    --gradient-1: linear-gradient(135deg, #112934 0%, #203a43 50%, #39456d 100%);
    --gradient-2: linear-gradient(135deg, #ff003c 0%, #f7e30a 100%);
    --card-gradient: linear-gradient(135deg, rgba(107, 17, 203, 0.322), rgba(252, 37, 130, 0.212));
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient-1);
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background gradient elements */
.bg-gradient-1, .bg-gradient-2 {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    z-index: -2;
    transition: transform 0.3s ease-out;
}

.bg-gradient-1 {
    background: var(--primary-color);
    top: -250px;
    left: -250px;
}

.bg-gradient-2 {
    background: var(--secondary-color);
    bottom: -250px;
    right: -250px;
}

.particles-container {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

#particles-js canvas {
    transition: all 1.5s ease;
}

.particle-glow {
    animation: particlePulse 2s ease-in-out;
}

@keyframes particlePulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.7; }
    100% { opacity: 0.9; }
}



/* Header Styles */
header {
    text-align: center;
    padding: 6rem 1rem 4rem;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
}

.header-content {
    position: relative;
    z-index: 2;
}

.title-wrapper {
    display: inline-block;
    position: relative;
    margin-bottom: 1rem;
}

.main-title {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.title-underline {
    height: 4px;
    width: 60%;
    margin: 0 auto;
    background: var(--gradient-2);
    border-radius: 2px;
    animation: scaleIn 0.8s ease 0.5s both;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    animation: fadeInUp 1s ease 0.3s both;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.github-btn, .color-cycle-btn {
    background: var(--gradient-2);
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.color-cycle-btn {
    background: linear-gradient(135deg, #f42f32 0%, #faea05 100%);
}

.github-btn::before, .color-cycle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.github-btn:hover::before, .color-cycle-btn:hover::before {
    left: 100%;
}

.github-btn:hover, .color-cycle-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.github-btn:active, .color-cycle-btn:active {
    transform: translateY(1px);
}

.github-btn i, .color-cycle-btn i {
    font-size: 1.2rem;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 0.7rem 1.2rem;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.sort-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.sort-container label {
    color: var(--text-primary);
    font-weight: 500;
}

.sort-container select {
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-container select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
}

.sort-container select option {
    background: var(--dark-color);
}

/* Projects Container */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1300px;
    margin: 0 auto;
    perspective: 1000px;
}

/* Project Card */
.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(50px) scale(0.95) rotateY(15deg);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    transform-style: preserve-3d;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-2);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.project-card:hover::before {
    transform: scaleX(1);
}

/* Reveal cards on scroll */
.project-card.show {
    opacity: 1;
    transform: translateY(0) scale(1) rotateY(0);
}

/* Staggered delay */
.project-card:nth-child(1) { transition-delay: 0.1s; }
.project-card:nth-child(2) { transition-delay: 0.2s; }
.project-card:nth-child(3) { transition-delay: 0.3s; }
.project-card:nth-child(4) { transition-delay: 0.4s; }
.project-card:nth-child(5) { transition-delay: 0.5s; }
.project-card:nth-child(6) { transition-delay: 0.6s; }
.project-card:nth-child(7) { transition-delay: 0.7s; }
.project-card:nth-child(8) { transition-delay: 0.8s; }

/* Hover effects */
.project-card:hover {
    transform: translateY(-10px) scale(1) rotateY(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Card Content */
.card-content {
    padding: 2rem;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.project-card:hover .card-content {
    transform: scale(1.03);
}

.project-card h2 {
    margin-top: 0;
    font-size: 1.8rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    font-weight: 700;
    margin-bottom: 1rem;
}

.project-card p {
    font-size: 1rem;
    margin-top: 0.5rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Tech Stack Tags */
.tech-tags {
    margin: 1.2rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tags span {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tech-tags span:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Links Section */
.card-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.card-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 500;
}

.card-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
}

.card-links a:hover::before {
    left: 100%;
}

.card-links a:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.date-info {
    margin-top: 1.2rem;
    font-size: 0.8rem;
    opacity: 0.7;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.8rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--card-border);
    position: relative;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--secondary-color);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}



/* Color themes */
body.theme-1 {
    --primary-color: #f71c77;
    --secondary-color: #ca25fc;
    --gradient-2: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

body.theme-2 {
    --primary-color: #ff4e50;
    --secondary-color: #f9d423;
    --gradient-2: linear-gradient(135deg, #ff4e50 0%, #f9d423 100%);
}

body.theme-3 {
    --primary-color: #0cebeb;
    --secondary-color: #20e3b2;
    --gradient-2: linear-gradient(135deg, #0cebeb 0%, #20e3b2 50%, #29ffc6 100%);
}

body.theme-4 {
    --primary-color: #f5576c;
    --secondary-color: #f093fb;
    --gradient-2: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

body.theme-5 {
    --primary-color: #5ee7df;
    --secondary-color: #b490ca;
    --gradient-2: linear-gradient(135deg, #5ee7df 0%, #b490ca 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .card-content {
        padding: 1.5rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .projects-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .card-links {
        flex-direction: column;
    }
    
    .card-links a {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    header {
        padding: 4rem 1rem 3rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .tech-tags {
        justify-content: center;
    }
    
    .date-info {
        flex-direction: column;
        gap: 0.3rem;
    }
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--accent-color);
    grid-column: 1 / -1;
    background: var(--card-bg);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
}

.loading {
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading::after {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

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

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