/* ============================================
   Estrutura geral da página
============================================ */
* {
    box-sizing: border-box; /* Garante que padding não quebre a largura da tela */
}
html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    font-family: Arial, sans-serif;
    background: linear-gradient(to bottom, #0e1f38, #1f4068, #33689e, #4a90e2, #609de6);
    background-attachment: fixed;
    color: #e0f0ff;

    display: flex;
    flex-direction: column;
}
/* ============================================
   Cabeçalho
============================================ */
header {
    color: white;
    padding: 20px 0;
    text-align: center;
    text-shadow: 1px 1px 2px black;
    width: 100%;
}
/* ============================================
   Conteúdo principal
============================================ */
main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-content: center;
    padding: 20px;
    margin: 0 auto;
}
/* ============================================
   Seção de projetos
============================================ */
.projetos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    justify-content: center;
    width: 100%;
}
/* ============================================
   Cartões de projeto
============================================ */
.card {
    position: relative;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    background-size: cover;
    background-position: center;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    justify-content: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    min-height: 250px; /* garante altura mínima estável */
    z-index: 1;
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 4px 4px 12px rgba(0,0,0,0.4);
}

/* Texto dentro dos cards */
.card h3,
.card p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 10px 0;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

.card a {
    position: relative;
    z-index: 2;
    display: inline-block;
    margin-top: 10px;
    background-color: #4a90e2;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    text-shadow: none;
    transition: background-color 0.2s;
}

.card a:hover {
    background-color: #3a7ac9;
}

/* Imagem de fundo dos cards */
.card img {
    position: absolute;
    inset: 0; /* substitui top/left/width/height */
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    z-index: 0;
    pointer-events: none; /* evita interferência em clique */

    mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
    mask-repeat: no-repeat;
    mask-size: cover;

    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: cover;
}

/* Botão de apagar projeto */
.btnDelete {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: white;
    transition: transform 0.2s ease, filter 0.3s ease;
    z-index: 3; /* acima da imagem */
}

.btnDelete:hover {
    transform: scale(1.3) rotate(-10deg);
    filter: drop-shadow(0 0 4px #4a90e2);
}
/* ============================================
   Rodapé
============================================ */
footer {
   background: linear-gradient(to top, rgba(14,31,56,1) 0%, rgba(31,64,104,1) 25%, rgba(51,104,158,1) 50%, rgba(74,144,226,0) 75%, rgba(96,157,230,0) 100%);
    color: white;
    text-align: center;
    padding: 20px 10px;
    width: 100%;
}
footer button {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
footer button:hover {
    background-color: #3a7ac9;
    color: white;
    transform: scale(1.05);
}
/* ============================================
   Fundo escurecido quando popup ativo
============================================ */
body.popup-ativo::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease;
}
/* ============================================
   Caixa do popup
============================================ */
.popup {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    color: #333;
    padding: 20px;
    border-radius: 10px;
    width: 320px;
    max-width: 90%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: none;
    z-index: 1000;
    text-align: center;
    animation: slideDown 0.3s ease;
}
/* Título do popup */
.popup h2 {
    margin-top: 0;
    color: #4a90e2;
}
/* Botões dentro do popup (exceto fechar) */
.popup button:not(.close-btn) {
    margin: 10px 5px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    background-color: #4a90e2;
    color: #fff;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.popup button:not(.close-btn):hover {
    background-color: #3a7ac9;
    transform: scale(1.05);
}
/* Botão de fechar (X) */
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    color: red;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
}
.close-btn:hover {
    color: darkred;
    transform: scale(1.2);
}
/* ============================================
   Campos de entrada
============================================ */
.popup input[type="text"],
.popup input[type="url"],
.popup input[type="file"],
.popup textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}
/* Campo de título e link com truncamento */
.popup input[type="text"],
.popup input[type="url"] {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
/* Campo de imagem */
.popup input[type="file"] {
    border: 1px dashed #ccc;
    background-color: #f5f5f5;
    cursor: pointer;
    overflow: hidden;
}
/* Campo de descrição */
.popup textarea {
    resize: none;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    word-break: break-word;
}
/* ============================================
   Pop-up de confirmação
============================================ */
.popup p {
    margin: 15px 0;
    color: #333;
}
#btnConfirmDelete {
    background-color: #e74c3c;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}
#btnConfirmDelete:hover {
    background-color: #c0392b;
    transform: scale(1.04);
}
#btnCancelDelete {
    background-color: #ccc;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}
#btnCancelDelete:hover {
    background-color: #95a5a6;
    color: #fff;
}
/* ============================================
   Animações
============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideDown {
    from { transform: translate(-50%, -60%); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
}
/* ============================================
   Tela de boas-vindas
============================================ */
#welcome-screen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #0a0a0a;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 1s ease-in-out, visibility 1s;
    margin: 0;
    padding: 0;
}
#welcome-screen.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}
.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.welcome-content h1 {
    font-family: 'Inter', sans-serif;
    font-size: clamp(2.5rem, 8vw, 4rem) !important;
    font-weight: 900;
    letter-spacing: -1px;
    margin: 0;
    color: #ffffff !important;
    animation: revealIn 1.5s ease-out forwards;
}
.welcome-content p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: #4a90e2 !important;
    letter-spacing: 5px;
    margin-top: 15px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInSub 1s ease-out 0.5s forwards;
}
.loader {
    width: 150px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}
.loader::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #4a90e2;
    animation: loadingMove 2s infinite ease-in-out;
}
@keyframes loadingMove {
    0% { left: -100%; }
    50% { left: 0; }
    100% { left: 100%; }
}
@keyframes revealIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInSub {
    to { opacity: 0.7; }
}

/* ============================================
   Conteúdo links
============================================ */
.social-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
}

.social-links a {
    color: white;
    transition: all 0.25s ease;
}

.social-links a:hover {
    color: #ffffff;
    transform: translateY(-3px);
    opacity: 0.9;
}
