/* ================================
   1) Imports de fontes
================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&family=Exo+2:wght@400;600&display=swap');

/* ================================
   2) Variáveis de tema
================================ */
:root {
    --primary-color: #0d1a2e;            /* Azul escuro principal */
    --secondary-color: #1a2942;          /* Azul para os painéis */
    --accent-color: #00d1ff;             /* Ciano neon futurista */
    --text-color: #f0f0f0;               /* Branco suave */
    --shadow-color: rgba(0, 209, 255, 0.2);
}

/* ================================
   3) Reset básico
================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ================================
   4) Base / Tipografia / Body
================================ */
body {
    font-family: 'Exo 2', sans-serif;
    color: var(--text-color);
    background-color: #05080f;
    /* Fundo estrelado sutil */
    background-image:
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 40px),
        radial-gradient(rgba(255,255,255,.4), rgba(255,255,255,.1) 2px, transparent 30px);
    background-size: 550px 550px, 350px 350px, 250px 250px, 150px 150px;
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

/* ================================
   5) Estrutura geral
================================ */
header {
    margin-bottom: 3rem;
    text-shadow: 0 0 15px var(--shadow-color);
}

header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(240, 230, 140, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.8;
}

main {
    max-width: 800px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

section {
    /* Painéis com glassmorphism */
    background: rgba(26, 41, 66, 0.6);
    border: 1px solid rgba(0, 209, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 0 10px var(--shadow-color);
    padding: 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 0.5rem;
    text-transform: uppercase;
}

/* ================================
   6) Seletor de Molduras
      <section class="frame-selector">
         <div id="frame-options"> ... </div>
================================ */
.frame-selector #frame-options {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Miniaturas das molduras (redondas tipo “planeta/portal”) */
.frame-selector img {
    width: 120px;
    height: 120px;
    border: 4px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
    background-color: rgba(0,0,0,0.3);
}

.frame-selector img:hover {
    opacity: 1;
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.frame-selector img.selected {
    opacity: 1;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--shadow-color);
    transform: scale(1.15);
}

/* ================================
   7) Módulo da Câmera
      <section class="camera-module">
         <div id="camera-container">
            <video id="video"> ... </video>
            <img id="frame-overlay"> ... </img>
================================ */
#camera-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: auto;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 25px var(--shadow-color);
    aspect-ratio: 4 / 5;          /* Força 4:5 no container */
    background-color: #000;        /* Fundo enquanto o vídeo carrega */
}

#video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;             /* Preenche 4:5 sem distorcer */
    transform: none;   
    /* transform: scaleX(-1);         /* “Selfie” espelhada */
}

#frame-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ================================
   8) Botões (CTA e link de download)
================================ */
.button,
button {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 1rem 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px var(--shadow-color);
    box-shadow: inset 0 0 10px var(--shadow-color), 0 0 10px var(--shadow-color);
}

.button:hover,
button:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    box-shadow: 0 0 25px var(--shadow-color);
    transform: translateY(-3px) scale(1.05);
}

/* Hover alternativo suave (quando quiser um amarelo claro) */
button:hover,
.button:hover {
    background: #fffacd;           /* Amarelo mais claro */
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow-color);
}

/* ================================
   9) Módulo de Resultado
      <section class="result-module">
         <img id="photo-result"> ... </img>
================================ */
.result-module img {
    max-width: 100%;
    border-radius: 10px;
    border: 5px solid var(--accent-color);
    box-shadow: 0 0 25px var(--shadow-color);
}

#photo-result {
    width: 100%;
    max-width: 640px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

/* ================================
   10) Utilidades / Responsivo (opcional)
================================ */
/* Exemplo de ajuste em telas menores */
@media (max-width: 480px) {
    header h1 { font-size: 2.2rem; }
    .button, button { width: 100%; }
}
