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

:root {
    --cor-primaria: #e5e5e5;
    --cor-secundaria: #173557;
    --cor-terciaria: #68813d;
    --cor-terciaria-suave: #d4e0bd;
    --cor-texto: #1a1a1a;
    --cor-texto-suave: #2c2c2c;
    --cor-fundo-pagina: #d1d1d1;
    --cor-rodape: #0e2035;
    --cor-fundo-destaque: #d4dde8;
    --cor-borda: #cccccc;
}

body {
    background-color: var(--cor-fundo-pagina);
    font-family: 'Poppins', sans-serif;
}

.verified-icon {
    width: 15px;
    height: 15px;
    fill: #0095f6;
    margin-left: 5px;
    display: inline-flex;
    align-self: center;
    flex-shrink: 0;
}

.ig-container {
    max-width: 935px;
    margin: 0 auto;
    padding: 30px 20px;
}

.ig-header {
    position: relative !important;
    display: flex;
    align-items: flex-start;
    margin-bottom: 44px;
    gap: 80px;
    padding: 20px 0;
    background: transparent;
    z-index: 1;
}

.ig-profile-pic-container {
    flex-shrink: 0;
    margin-left: 20px;
}

.ig-profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--cor-borda);
    padding: 4px;
    background-color: var(--cor-primaria);
}

.ig-profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    color: var(--cor-texto);
}

.ig-username-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.ig-username {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--cor-texto);
    display: flex;
    align-items: center;
}

.ig-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
    list-style: none;
}

.ig-stats li {
    font-size: 1rem;
    color: var(--cor-texto);
}

.ig-stats span {
    font-weight: 600;
}

.ig-display-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--cor-texto);
}

.ig-bio p {
    margin: 0;
    color: var(--cor-texto);
    font-size: 0.95rem;
    line-height: 1.5;
}

.ig-tabs {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--cor-borda);
    margin-bottom: 0;
}

.ig-tab {
    padding: 15px 30px;
    color: #8e8e8e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid transparent;
    margin-top: -1px;
    transition: color 0.2s ease;
}

.ig-tab.active {
    color: var(--cor-texto);
    border-top: 1px solid var(--cor-texto);
}

.ig-tab:hover {
    color: var(--cor-texto-suave);
}

.ig-tab svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.ig-tab span {
    display: none;
}

.ig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 10px;
}

.ig-post {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background-color: var(--cor-primaria);
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.ig-post::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.ig-post:hover {
    transform: scale(0.98);
}

.ig-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.ig-post:hover img {
    filter: brightness(0.85);
}

.ig-carousel-icon,
.ig-video-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    fill: #fff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    pointer-events: none;
    z-index: 2;
}

.modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff;
    font-size: 35px;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    transition: color 0.2s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.close-btn:hover {
    color: #ddd;
}

.modal-content {
    background-color: var(--cor-primaria);
    width: 100%;
    max-width: 1100px;
    height: 85vh;
    border-radius: 16px;
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.carousel-wrapper {
    flex: 1.5;
    background-color: #000;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.modal-photo-count {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 16px;
    z-index: 20;
    font-weight: 600;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    outline: none;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 16px;
    color: var(--cor-texto);
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.nav-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.05);
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

.post-details {
    width: 350px;
    background-color: var(--cor-primaria);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--cor-borda);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--cor-borda);
}

.post-header img,
.post-caption-block img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--cor-borda);
}

.post-header strong {
    color: var(--cor-texto);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.post-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.post-caption-block {
    display: flex;
    gap: 12px;
}

.post-caption-block img {
    flex-shrink: 0;
}

.post-caption-text {
    font-size: 0.95rem;
    color: var(--cor-texto);
    line-height: 1.5;
}

.post-caption-text strong {
    margin-right: 5px;
    display: inline-flex;
    align-items: center;
}

.post-footer {
    border-top: 1px solid var(--cor-borda);
    padding: 14px 16px;
    background-color: var(--cor-primaria);
}

.post-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.post-actions svg {
    width: 26px;
    height: 26px;
    fill: var(--cor-texto);
    cursor: pointer;
    transition: fill 0.2s;
}

.post-actions svg:hover {
    fill: var(--cor-texto-suave);
}

.post-date {
    font-size: 0.75rem;
    color: #8e8e8e;
    text-transform: uppercase;
    font-weight: 600;
}

.dev-credit {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.8rem;
    color: #8e8e8e;
    padding: 30px 20px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.dev-credit:hover {
    color: var(--cor-texto);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .ig-container {
        padding: 10px 0;
    }

    .ig-header {
        display: grid;
        grid-template-columns: 85px 1fr;
        grid-template-areas: "pic username" "pic stats" "bio bio";
        gap: 10px 20px;
        padding: 10px 15px 20px 15px;
        margin-bottom: 0;
    }

    .ig-profile-pic-container {
        grid-area: pic;
        margin: 0;
    }

    .ig-profile-pic {
        width: 85px;
        height: 85px;
    }

    .ig-profile-info {
        display: contents;
    }

    .ig-username-row {
        grid-area: username;
        margin: 0;
        align-self: end;
    }

    .ig-username {
        font-size: 1.2rem;
    }

    .ig-stats {
        grid-area: stats;
        margin: 0;
        gap: 15px;
        justify-content: flex-start;
        align-self: start;
    }

    .ig-stats li {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 0.85rem;
        color: #8e8e8e;
    }

    .ig-stats span {
        color: var(--cor-texto);
        font-size: 1rem;
    }

    .ig-bio {
        grid-area: bio;
        margin-top: 10px;
        font-size: 0.95rem;
    }

    .ig-tabs {
        justify-content: space-around;
        width: 100%;
    }

    .ig-tab {
        padding: 10px;
        flex: 1;
    }

    .ig-grid {
        gap: 4px;
        padding: 4px;
    }

    .ig-post {
        border-radius: 4px;
    }

    .modal-overlay {
        padding: 0;
    }

    .modal-content {
        flex-direction: column;
        height: 100dvh;
        border-radius: 0;
    }

    .carousel-wrapper {
        flex: none;
        height: 50dvh;
    }

    .post-details {
        width: 100%;
        flex: 1;
        border-left: none;
        display: flex;
        flex-direction: column;
    }

    .close-btn {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 26px;
        padding-bottom: 3px;
    }

    .modal-photo-count {
        top: 15px;
        left: 15px;
        right: auto;
    }

    .nav-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

.grade-links-sociais {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 24px 16px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.grade-links-sociais.ativo {
    display: flex;
}

.cartao-link-social {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--cor-primaria);
    border: 1px solid var(--cor-borda);
    border-radius: 12px;
    text-decoration: none;
    color: var(--cor-texto);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 15px;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cartao-link-social:hover,
.cartao-link-social:active {
    transform: scale(0.98);
    background-color: var(--cor-fundo-destaque);
}

.icone-link-social {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    width: 32px;
    height: 32px;
}

.texto-link-social {
    flex-grow: 1;
}

.seta-link-social {
    color: var(--cor-texto-suave);
    opacity: 0.7;
    display: flex;
    align-items: center;
}

.botao-alunos {
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.botao-alunos:hover,
.botao-alunos:hover span {
    color: var(--cor-secundaria) !important;
}