/* ==========================================================================
   DESIGN SYSTEM - CORES & FONTES (Colégio Sistema)
   ========================================================================== */
:root {
    /* Cores Oficiais da Identidade Visual */
    --brand-blue: #0003ff;
    --brand-yellow: #ffce00;
    --brand-white: #ffffff;
    --brand-black: #000000;

    /* Cores Auxiliares (Derivadas estritamente da paleta oficial) */
    --card-bg: var(--brand-white);
    --card-bg-hover: var(--brand-white);
    --card-border: var(--brand-white);
    --text-primary: var(--brand-white);
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.6);

    /* Tipografia */
    --font-title: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Espaçamentos e Bordas */
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-round: 50%;
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   RESET & CONFIGURAÇÕES BÁSICAS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: var(--font-body);
    background-color: var(--brand-black);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

body {
    /* Fundo sólido em azul oficial do design.md */
    background-color: var(--brand-blue);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

/* ==========================================================================
   ELEMENTOS DE DECORAÇÃO (SVG DE FUNDO)
   ========================================================================== */
.bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    /* Renderiza acima do fundo sólido do body */
    pointer-events: none;
    overflow: hidden;
}

.bg-wave {
    position: absolute;
    width: 150%;
    height: 120%;
    top: -10%;
    left: -25%;
    opacity: 1;
}

/* Linha amarela orgânica em destaque cruzando a página */
.yellow-wave {
    opacity: 1;
    animation: float-wave-primary 20s ease-in-out infinite alternate;
}

@keyframes float-wave-primary {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(-30px, 40px) rotate(3deg);
    }
}

@keyframes float-wave-secondary {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(40px, -30px) rotate(-3deg);
    }
}

/* ==========================================================================
   CONTAINER PRINCIPAL
   ========================================================================== */
.app-container {
    position: relative;
    z-index: 2;
    /* Renderiza acima das decorações do background */
    width: 100%;
    max-width: 580px;
    /* Largura ideal para visual premium tanto mobile quanto desktop */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 80px);
}

/* ==========================================================================
   CABEÇALHO (HEADER)
   ========================================================================== */
.app-header {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

.logo-wrapper {
    margin: 0 auto 24px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.logo-img {
    width: 190px;
    height: auto;
    object-fit: contain;
    transition: var(--transition-smooth);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.logo-img:hover {
    transform: scale(1.08);
}

.brand-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 800;
    /* Poppins Extra Bold */
    color: var(--brand-white);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    display: inline-block;
    min-height: 36px;
}

/* Cursor de digitação piscante */
.brand-title.typing-active::after {
    content: '|';
    margin-left: 3px;
    color: var(--brand-yellow);
    animation: blinkCursor 0.8s step-end infinite;
    font-weight: 400;
}

@keyframes blinkCursor {
    from, to {
        color: transparent;
    }
    50% {
        color: var(--brand-yellow);
    }
}

@media (max-width: 480px) {
    .brand-title {
        min-height: 72px; /* Reserva espaço para 2 linhas no mobile e evita layout shift */
    }
}

.brand-description {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 440px;
    margin: 0 auto;
    font-weight: 400;
}

/* ==========================================================================
   NAVEGAÇÃO / CONTAINER DE LINKS
   ========================================================================== */
.app-main {
    width: 100%;
    margin-bottom: 40px;
}

#links-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.loading-state {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Estilo Individual dos Cartões de Link (Brancos com Bordas Arredondadas) */
.link-card {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 18px 24px;
    background: var(--card-bg);
    border: 2px solid var(--brand-white);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--brand-black);
    /* Texto em preto */
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    outline: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

/* Efeito de clique suave */
.link-card:active {
    transform: scale(0.97) translateY(0) !important;
    background: rgba(255, 255, 255, 0.05);
}

/* Foco de teclado acessível */
.link-card:focus-visible {
    outline: 2px solid var(--brand-yellow);
    outline-offset: 4px;
    transform: translateY(-2px);
}

/* Hover nos Cartões */
.link-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-yellow);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25),
        0 0 15px rgba(255, 206, 0, 0.3);
}

/* Layout Interno do Cartão */
.link-icon-wrapper {
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 18px;
    transition: var(--transition-smooth);
    flex-shrink: 0;
    color: rgba(0, 0, 0, 0.75); /* Cor escura padrão */
}

.link-icon-wrapper svg {
    width: 100%;
    height: 100%;
    display: block;
}

.link-card:hover .link-icon-wrapper {
    color: var(--brand-blue); /* Ícone fica azul no hover do card */
    transform: scale(1.12);
}

.link-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.link-title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
    color: var(--brand-black);
    /* Título em preto */
    transition: var(--transition-smooth);
}

.link-card:hover .link-title {
    color: var(--brand-blue);
}

.link-desc {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: rgba(0, 0, 0, 0.6);
    /* Descrição em tom escuro para boa legibilidade */
    font-weight: 400;
}

.link-arrow {
    font-size: 1.2rem;
    color: rgba(0, 0, 0, 0.35);
    /* Seta em cinza escuro */
    transition: var(--transition-smooth);
    margin-left: 10px;
    display: flex;
    align-items: center;
}

.link-card:hover .link-arrow {
    color: var(--brand-blue);
    transform: translateX(4px);
}

/* Link Destacado (Highlight / Atenção Especial) */
.link-card.highlighted {
    background: var(--brand-white);
    border: 2px solid var(--brand-yellow);
    box-shadow: 0 6px 18px rgba(255, 206, 0, 0.2);
}

.link-card.highlighted:hover {
    box-shadow: 0 12px 28px rgba(255, 206, 0, 0.3),
        0 0 20px rgba(0, 3, 254, 0.15);
}

.link-card.highlighted .link-title {
    color: var(--brand-black);
}

.link-card.highlighted:hover .link-title {
    color: var(--brand-blue);
}

/* Badge de destaque */
.highlight-badge {
    position: absolute;
    top: 0;
    right: 20px;
    background: var(--brand-yellow);
    color: var(--brand-black);
    font-family: var(--font-title);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 0 0 8px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   RODAPÉ (FOOTER)
   ========================================================================== */
.app-footer {
    width: 100%;
    margin-top: auto;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Navegação Social */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-round);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    outline: none;
}

.social-item:focus-visible {
    outline: 2px solid var(--brand-yellow);
    outline-offset: 4px;
}

.social-icon {
    width: 20px;
    height: 20px;
    transition: var(--transition-smooth);
}

.social-item:hover {
    color: var(--brand-black);
    background: var(--brand-yellow);
    border-color: var(--brand-yellow);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 206, 0, 0.3);
}

.social-item:hover .social-icon {
    transform: scale(1.1);
}

.footer-copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   ANIMAÇÕES DE ENTRADA (CSS ONLY)
   ========================================================================== */
/* Fade in inicial do container */
.fade-in {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInIntro 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Atraso para a lista de links e rodapé */
.fade-in-delayed {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInIntro 1s cubic-bezier(0.25, 1, 0.5, 1) 0.2s forwards;
}

@keyframes fadeInIntro {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animação de entrada dos cards (injetada dinamicamente via JS) */
@keyframes slideInCard {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   RESPONSIVIDADE (MOBILE FIRST)
   ========================================================================== */
/* Dispositivos muito pequenos (telas < 360px) */
@media (max-width: 360px) {
    body {
        padding: 20px 12px;
    }

    .brand-title {
        font-size: 1.8rem;
    }

    .link-card {
        padding: 14px 18px;
    }

    .link-icon-wrapper {
        margin-right: 12px;
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .link-title {
        font-size: 0.95rem;
    }
}

/* Orientação Landscape / Paisagem no Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 20px;
    }

    .app-container {
        min-height: auto;
    }

    .logo-wrapper {
        width: 80px;
        height: 80px;
    }

    .brand-title {
        font-size: 1.6rem;
    }
}