/* ===========================
   CSS VARIABLES & THEMING
   =========================== */

:root {
    /* Dark mode variables (default) */
    --primary: #0a192f;
    --secondary: #112240;
    --accent: #64ffda;
    --text: #8892b0;
    --light-text: #ccd6f6;
    --bg-color: #0a192f;
    --card-bg: #112240;
    --form-bg: rgba(255, 255, 255, 0.05);
    --form-border: rgba(255, 255, 255, 0.1);
}

/* Light mode variables */
.light-mode {
    --primary: #f5f5f5;
    --secondary: #e0e0e0;
    --accent: #0a6c61;
    --text: #4a4a4a;
    --light-text: #2c2c2c;
    --bg-color: #ffffff;
    --card-bg: #f0f0f0;
    --form-bg: rgba(0, 0, 0, 0.03);
    --form-border: rgba(0, 0, 0, 0.1);
}

/* ===========================
   GLOBAL STYLES
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===========================
   HEADER SECTION
   =========================== */

.accent-text {
    color: var(--accent);
}

.header {
    text-align: center;
    padding: 4rem 0 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    position: relative;
}

.header h1 {
    font-size: 3rem;
    font-weight: bold;
    color: var(--light-text);
    margin-bottom: 1rem;
}

.header p {
    font-size: 1.2rem;
    color: var(--text);
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--light-text);
    text-decoration: none;
    transition: all 0.3s ease;
    position: absolute;
    top: 20px;
    left: 20px;
}

.logo:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ===========================
   THEME TOGGLE
   =========================== */

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.theme-toggle i {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 24px;
    color: var(--light-text);
    transition: all 0.3s ease;
}

.dark-mode .light-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.dark-mode .dark-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.light-mode .light-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

.light-mode .dark-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* ===========================
   FILTER CONTROLS
   =========================== */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background: var(--secondary);
    border: 1px solid rgba(100, 255, 218, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 20px auto;
    max-width: 1200px;
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.filter-btn {
    appearance: none;
    border: 1px solid rgba(100, 255, 218, 0.2);
    background: var(--card-bg);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.filter-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 5px 15px rgba(100, 255, 218, 0.2);
}

.filter-btn.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(100, 255, 218, 0.1) 0%, rgba(79, 172, 254, 0.1) 100%);
    color: var(--accent);
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1), 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ===========================
   PROJECT SECTIONS
   =========================== */

.category-section {
    margin-bottom: 5rem;
    padding: 2rem 0;
}

.category-title {
    font-size: 2rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 2rem;
    position: relative;
    padding-left: 40px;
    text-align: left;
}

.category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), rgba(100, 255, 218, 0.5));
    border-radius: 2px;
}

.category-title i {
    margin-right: 10px;
    font-size: 1.5rem;
}

/* ===========================
   PROJECT CARDS
   =========================== */

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin-bottom: 30px;
    height: 100%;
    border: 1px solid rgba(100, 255, 218, 0.1);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(100, 255, 218, 0.05) 0%, rgba(79, 172, 254, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border-color: rgba(100, 255, 218, 0.3);
}

.project-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-img {
    transform: scale(1.1);
}

.project-content {
    padding: 25px;
    position: relative;
    z-index: 2;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.project-card:hover .project-title {
    color: var(--accent);
}

.project-description {
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
}

/* ===========================
   TECHNOLOGY TAGS
   =========================== */

.project-tech {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 25px;
    gap: 8px;
}

.tech-tag {
    background: linear-gradient(135deg, rgba(100, 255, 218, 0.1) 0%, rgba(79, 172, 254, 0.1) 100%);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(100, 255, 218, 0.2);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tech-tag:hover {
    background: var(--accent);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 255, 218, 0.3);
}

/* ===========================
   PROJECT LINKS
   =========================== */

.project-links {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
}

.project-links a {
    color: var(--light-text);
    font-size: 1.3rem;
    transition: all 0.3s ease;
    padding: 12px;
    border-radius: 50%;
    background: rgba(100, 255, 218, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    text-decoration: none;
}

.project-links a:hover {
    color: var(--primary);
    background: var(--accent);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 20px rgba(100, 255, 218, 0.4);
}

/* ===========================
   FEATURED PROJECT STYLING
   =========================== */

.featured-project {
    border: 2px solid var(--accent);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(100, 255, 218, 0.05) 100%);
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.1);
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(100, 255, 218, 0.3);
}

/* ===========================
   LOADING & ERROR STATES
   =========================== */

#loading {
    color: var(--text);
    padding: 3rem 0;
}

#loading .spinner-border {
    color: var(--accent);
    width: 3rem;
    height: 3rem;
}

#error-message {
    margin: 2rem auto;
    max-width: 600px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 10px;
}

/* ===========================
   ANIMATIONS
   =========================== */

.project-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delays */
.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; }

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
    .header {
        padding: 3rem 0 2rem;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .header p {
        font-size: 1rem;
        padding: 0 20px;
    }
    
    .logo {
        font-size: 20px;
        top: 15px;
        left: 15px;
    }
    
    .theme-toggle {
        top: 15px;
        right: 15px;
    }
    
    .filters {
        margin: 15px;
        padding: 15px;
    }
    
    .filter-btn {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
    
    .category-title {
        font-size: 1.5rem;
        padding-left: 35px;
    }
    
    .category-title i {
        font-size: 1.2rem;
    }
    
    .project-img {
        height: 200px;
    }
    
    .project-content {
        padding: 20px;
    }
    
    .project-title {
        font-size: 1.2rem;
    }
    
    .tech-tag {
        font-size: 0.7rem;
        padding: 5px 12px;
    }
    
    .project-links a {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .header {
        padding: 2.5rem 0 1.5rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .filters {
        padding: 12px;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }
    
    .category-title {
        font-size: 1.3rem;
        text-align: center;
        padding-left: 0;
        margin-bottom: 1.5rem;
    }
    
    .category-title::before {
        display: none;
    }
    
    .project-links {
        justify-content: center;
    }
}

/* ===========================
   UTILITY CLASSES
   =========================== */

.text-center {
    text-align: center;
}

.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.d-none {
    display: none;
}