/* ============================
   GLOBAL RESET
============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.index-page {
    font-family: "Inter", sans-serif;
    color: #222;
    line-height: 1.6;
    background: #fafafa;
}

/* ============================
   INDEX PAGE LAYOUT
============================ */
.index-page .layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.index-page .sidebar {
    width: 280px;
    background: #f5f5f5;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 0;
    height: 100vh;
}

.index-page .profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.index-page .profile img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.index-page .profile h1 {
    font-size: 1.4rem;
    text-align: center;
}

.index-page .profile h2 {
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    opacity: 0.7;
}

/* MAIN CONTENT */
.index-page .main {
    flex: 1;
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* TOP NAV */
.index-page .top-nav ul {
    display: flex;
    justify-content: flex-end;
    gap: 2.5rem;
    list-style: none;
    margin-bottom: 2rem;
}

.index-page .top-nav a {
    position: relative;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding-bottom: 4px;
    transition: color 0.25s ease;
}

.index-page .top-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 2px;
    background: #007bff;
    transition: width 0.25s ease;
}

.index-page .top-nav a:hover {
    color: #007bff;
}

.index-page .top-nav a:hover::after {
    width: 100%;
}

/* FILTER BAR */
.index-page .filter-bar {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.index-page .filter-bar button {
    padding: 0.5rem 1rem;
    border: none;
    background: #eaeaea;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.index-page .filter-bar button:hover {
    background: #d5d5d5;
    transform: translateY(-2px);
}

.index-page .filter-bar .active {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
}

/* PORTFOLIO GRID */
.index-page .portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* CARD */
.index-page .card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    flex: 1 1 calc(33% - 1rem);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;
    opacity: 1;
}

.index-page .card.hidden {
    opacity: 0;
    pointer-events: none;
}

.index-page .card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.index-page .card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* IMAGE WRAPPER */
.index-page .image-wrapper {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.index-page .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* OVERLAY */
.index-page .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: opacity 0.3s ease;
}

.index-page .image-wrapper:hover .overlay {
    opacity: 1;
}

/* CARD CONTENT */
.index-page .card-content {
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.index-page .card-content h3 {
    font-size: 1.1rem;
}

.index-page .card-content .description {
    font-size: 0.9rem;
    color: #555;
}

/* TAGS */
.index-page .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.index-page .tags span {
    background: #eef3ff;
    color: #3a5bcc;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.index-page .tags span:hover {
    background: #dce6ff;
    transform: translateY(-2px);
}

.index-page .tags span.active-tag {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .index-page .sidebar {
        width: 220px;
    }

    .index-page .card {
        flex: 1 1 calc(50% - 1rem);
    }
}

@media (max-width: 768px) {
    .index-page .layout {
        flex-direction: column;
    }

    .index-page .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.5rem;
    }

    .index-page .main {
        padding: 2rem 1.5rem;
    }

    .index-page .top-nav ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .index-page .card {
        flex: 1 1 100%;
    }
}
