:root {
    --bg-color: #fafafa;
    --text-color: #262626;
    --border-color: #dbdbdb;
    --button-color: #0095f6;
    --button-text-color: #ffffff;
    --secondary-text-color: #8e8e8e;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    font-size: 16px;
    padding-top: 80px;
}

/* Page Index Navigation */
.page-index {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    text-align: center;
    padding: 15px 0;
}

.page-index ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: inline-flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.page-index li {
    display: inline;
}

.page-index a {
    text-decoration: none;
    color: var(--button-color);
    font-weight: 500;
    font-size: 24px;
    padding: 6px 12px;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.page-index a:hover {
    background-color: rgba(0, 149, 246, 0.1);
}

.profile-container {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-container:last-child {
    border-bottom: none;
}

#app-container {
    max-width: 935px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Header */
.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.profile-pic-container {
    flex: 1;
    display: flex;
    justify-content: center;
    margin-right: 30px;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    flex: 2;
}

.profile-info-top {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.username {
    font-size: 28px;
    font-weight: 300;
    margin: 0;
}

.follow-btn {
    background-color: var(--button-color);
    color: var(--button-text-color);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 5px 20px;
    font-weight: 500;
    margin-left: 20px;
    cursor: pointer;
}

.more-options-btn {
    background: none;
    border: none;
    font-size: 20px;
    font-weight: bold;
    margin-left: 10px;
    cursor: pointer;
}

.profile-stats ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
}

.profile-stats li {
    margin-right: 40px;
}

.stat-number {
    font-weight: 500;
}

.profile-bio .name {
    font-weight: 500;
    margin: 0 0 5px 0;
}

.profile-bio p {
    margin: 0;
    line-height: 1.4;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.tab {
    padding: 15px 10px;
    margin: 0 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--secondary-text-color);
    cursor: pointer;
    position: relative;
}

.tab.active {
    color: var(--text-color);
    border-top: 1px solid var(--text-color);
    margin-top: -1px;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.post-item {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    cursor: pointer;
}

.post-item .post-number {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1;
    z-index: 1;
    pointer-events: none;
}

.keyword-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 1.8vw;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.post-item:hover .keyword-overlay {
    opacity: 1;
}

.post-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Instructions Box */
.instructions-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 25px;
    text-align: center;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

.instructions-container p {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    text-transform: uppercase;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

/* Profile Description Box */
.profile-description {
    max-width: 900px;
    margin: 20px auto 0;
    padding: 20px;
    text-align: left;
    background-color: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.profile-description p {
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 10px 0;
}

.profile-description p:last-child {
    margin-bottom: 0;
}

/* Hashtag Guessing Section */
.hashtag-guess-section {
    max-width: 900px;
    margin: 40px auto;
    padding: 25px;
    text-align: center;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.hashtag-guess-section h2 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-color);
}

.hashtag-list-interactive {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 700px;
}

.hashtag-item {
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.hashtag-question {
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 500;
    color: var(--button-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.toggle-icon {
    font-size: 24px;
    font-weight: 300;
    transition: transform 0.2s ease;
}

.hashtag-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    padding: 0 20px;
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.6;
}

.hashtag-answer p {
    margin: 0;
    padding-bottom: 15px;
}

.hashtag-item.active .hashtag-answer {
    max-height: 200px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .profile-pic {
        width: 100px;
        height: 100px;
    }

    .profile-info {
        margin-top: 20px;
        text-align: left;
    }

    .profile-info-top {
        justify-content: center;
        flex-wrap: wrap;
    }

    .profile-stats ul {
       justify-content: space-around;
       border-top: 1px solid var(--border-color);
       border-bottom: 1px solid var(--border-color);
       padding: 10px 0;
    }

    .profile-stats li {
        margin: 0 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .profile-bio {
        padding: 0 10px;
    }

    .posts-grid {
        gap: 3px;
    }

    .keyword-overlay {
        font-size: 4.5vw;
    }

    .instructions-container {
        margin-left: 15px;
        margin-right: 15px;
    }

    .profile-description {
        margin-left: 15px;
        margin-right: 15px;
    }

    .instructions-container p {
        font-size: 14px;
    }

    .hashtag-guess-section {
        margin-left: 15px;
        margin-right: 15px;
    }

    .hashtag-guess-section h2 {
        font-size: 20px;
    }

    .hashtag-question {
        font-size: 16px;
    }
}