/* =============================
   THEME VARIABLES
============================= */
:root {
    --bg-body: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #aaa;
    --surface-0: #1a1a1a;
    --surface-0-border: #333;
    --surface-1: #0f0f0f;
    --surface-1-border: #222;
    --badge-bg: #333;
    --badge-text: #aaa;
    --accent: #8ad4d1;
    --accent-contrast: #000;
    --hover-bg: #fff;
    --hover-text: #000;
    --overlay-bg: rgba(10, 10, 10, 0.8);
    --modal-bg: #1a1a1a;
    --shadow-soft: rgba(255, 255, 255, 0.05);
    --shadow-strong: rgba(0, 0, 0, 0.3);
    --loader-track: #333;
    --loader-spin: var(--accent);
    --transition-speed: 0.3s;
}

[data-theme="light"] {
    --bg-body: #e0e4eb;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --surface-0: #fff;
    --surface-0-border: #ddd;
    --surface-1: #f1f1f1;
    --surface-1-border: #d0d0d0;
    --badge-bg: #f1f1f1;
    --badge-text: #777;
    --accent: #0088cc;
    --accent-contrast: #fff;
    --hover-bg: #111;
    --hover-text: #fff;
    --overlay-bg: rgba(255, 255, 255, 0.85);
    --modal-bg: #fff;
    --shadow-soft: rgba(0, 0, 0, 0.08);
    --shadow-strong: rgba(0, 0, 0, 0.15);
    --loader-track: #ddd;
    --loader-spin: var(--accent);
}

/* =============================
   RESET & BASE
============================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

a {
    color: var(--accent);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--hover-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* =============================
   HEADER
============================= */
.header {
    text-align: center;
    margin-bottom: 4rem;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.header .subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-secondary);
}

/* =============================
   FEATURED PROJECT
============================= */
.featured-project {
    position: relative;
    padding: 3rem;
    margin-bottom: 3rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--surface-0), var(--surface-1));
    box-shadow: 0 10px 30px var(--shadow-strong);
    overflow: hidden;
}

.featured-project::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.1), rgba(156, 39, 176, 0.1));
    z-index: 0;
}

.featured-content {
    position: relative;
    z-index: 1;
}

/* overrides */
.featured-project .project-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    transform: none !important;
}

.featured-project .project-card:hover {
    box-shadow: none;
}

.featured-project .card-header,
.featured-project .card-title,
.featured-project .card-category,
.featured-project .card-description {
    text-align: left;
}

.featured-project .project-tabs,
.featured-project .tech-stack,
.featured-project .project-links {
    margin-top: 1rem;
}

.project-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #42a5f5, #9c27b0);
}

.project-title {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-category {
    display: inline-block;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 20px;
    background-color: var(--badge-bg);
    color: var(--badge-text);
}

.project-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* =============================
   VIEW ALL BUTTON
============================= */
.view-all-btn {
    display: block;
    margin: 3rem auto;
    padding: 1rem 2rem;
    font-size: 1rem;
    border: 1px solid var(--surface-0-border);
    border-radius: 10px;
    background: var(--surface-0);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: var(--surface-1);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* =============================
   FILTER SECTION
============================= */
.filter-section {
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.filter-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 120px;
    min-height: 44px;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 25px;
    background: var(--surface-0);
    border: 2px solid var(--surface-0-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.filter-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #42a5f5, #1976d2);
    border-color: #42a5f5;
    box-shadow: 0 4px 12px rgba(66, 165, 245, 0.3);
    transform: translateY(-2px);
}

.project-count {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

/* =============================
   PROJECTS GRID
============================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

.project-card {
    padding: 2rem;
    border-radius: 15px;
    background: var(--surface-0);
    border: 1px solid var(--surface-0-border);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px var(--shadow-strong);
}

.project-card.hidden {
    display: none;
}

.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.card-icon {
    width: 50px;
    height: 50px;
    margin-right: 1rem;
    font-size: 1.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* icon variants */
.web-dev-icon {
    background: linear-gradient(135deg, var(--accent), #1976d2);
}

.electrical-icon {
    background: linear-gradient(135deg, #ffa726, #f57c00);
}

.biomedical-icon {
    background: linear-gradient(135deg, #26c6da, #00acc1);
}

.data-science-icon {
    background: linear-gradient(135deg, #ab47bc, #8e24aa);
}

.mobile-icon {
    background: linear-gradient(135deg, #66bb6a, #43a047);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-category {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 15px;
    background: var(--badge-bg);
    color: var(--badge-text);
}

.card-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* =============================
   PROJECT TABS & LINKS
============================= */
.project-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tab {
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab.active {
    color: var(--text-primary);
    border-bottom-color: #42a5f5;
}

.tab:hover {
    color: var(--text-primary);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
    background: rgba(66, 165, 245, 0.2);
    color: #42a5f5;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.project-link {
    padding: 8px 16px;
    font-size: 0.85rem;
    border: none;
    border-radius: 20px;
    background: var(--accent-color, var(--accent));
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.project-link:hover {
    background: var(--surface-0);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.features-content,
.process-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

.features-list,
.process-list {
    padding-left: 1.2rem;
    margin: 0;
}

.features-list li,
.process-list li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =============================
   THEME TOGGLE
============================= */
.theme-toggle-slider {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999999 !important;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.theme-toggle-slider.hidden {
    opacity: 0;
    pointer-events: none;
}

.slider-container {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 36px;
}

.slider-container input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: -1;
}

.slider-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 0 6px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px) saturate(180%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background 0.4s ease, transform 0.3s ease;
}

.slider-circle {
    position: absolute;
    top: 50%;
    left: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 6px rgba(255, 255, 255, 0.6) inset;
    transform: translateY(-50%);
    transition: left 0.4s ease, transform 0.3s ease;
}

.slider-input:checked+.slider-track .slider-circle {
    left: 38px;
}

[data-theme="light"] .slider-track {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .slider-circle {
    background: rgba(0, 0, 0, 0.85);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 6px rgba(0, 0, 0, 0.1) inset;
}

/* =============================
   FOOTER
============================= */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    font-size: 0.9rem;
    text-align: center;
    background-color: var(--surface-0);
    border-top: 1px solid var(--surface-0-border);
    color: var(--text-secondary);
}

footer .socials-icons,
footer .nav-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

footer a {
    font-size: 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: 0.3s;
}

footer a:hover {
    color: var(--text-primary);
}

/* =============================
   RESPONSIVE
============================= */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .featured-project {
        padding: 1.5rem;
    }

    .project-title {
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .card-description {
        font-size: 0.9rem;
    }

    .filter-buttons {
        gap: 0.6rem;
        padding: 0;
    }

    .filter-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        min-width: 110px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .filter-section {
        padding: 0 0.5rem;
    }

    .filter-buttons {
        gap: 0.5rem;
        justify-content: center;
    }

    .filter-btn {
        padding: 0.65rem 1rem;
        font-size: 0.8rem;
        min-width: 100px;
        border-radius: 20px;
    }

    .filter-btn:nth-child(-n+2),
    .filter-btn:nth-child(n+3) {
        flex: 0 0 calc(50% - 0.25rem);
        max-width: calc(50% - 0.25rem);
        min-width: auto;
    }

    .projects-grid {
        gap: 1.2rem;
        padding: 0;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 400px) {

    footer .socials-icons,
    footer .nav-icons {
        gap: 0.8rem;
    }
}

@media (max-width: 360px) {
    .filter-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.75rem;
    }

    .filter-btn:nth-child(-n+2),
    .filter-btn:nth-child(n+3) {
        flex: 0 0 calc(50% - 0.25rem);
        max-width: calc(50% - 0.25rem);
        text-align: center;
    }
}

/* =============================
   READ MORE BUTTON
============================= */
.read-more-btn {
    margin-top: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    border: none;
    border-radius: 20px;
    background: var(--accent-color, var(--accent));
    color: #422121;
    cursor: pointer;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background: var(--accent-color-hover, #0056b3);
    transform: translateY(-1px);
}