/* ============================================================
   AppMedico — Design Calmante v2: Fundo vivo, animações fortes
   ============================================================ */

/* ---- Fundo Global Animado (canvas de gradiente) ---- */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 25%, #10b981 50%, #0ea5e9 75%, #818cf8 100%);
    background-size: 400% 400%;
    animation: bgShift 12s ease infinite;
}

.dark #bg-canvas {
    background: linear-gradient(135deg, #0f172a 0%, #0c1a2e 25%, #071e25 50%, #0f172a 75%, #1e1b4b 100%);
    background-size: 400% 400%;
    animation: bgShift 12s ease infinite;
}

@keyframes bgShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- Orbs Flutuantes ---- */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    animation: floatOrb linear infinite;
    pointer-events: none;
    z-index: 1;
}

.orb-1 {
    width: 400px; height: 400px;
    background: rgba(186, 230, 253, 0.55);
    top: -100px; left: -100px;
    animation-duration: 18s;
}
.orb-2 {
    width: 320px; height: 320px;
    background: rgba(167, 243, 208, 0.50);
    top: 40%; right: -80px;
    animation-duration: 22s;
    animation-delay: -7s;
}
.orb-3 {
    width: 280px; height: 280px;
    background: rgba(196, 181, 253, 0.45);
    bottom: 15%; left: 5%;
    animation-duration: 16s;
    animation-delay: -12s;
}
.orb-4 {
    width: 220px; height: 220px;
    background: rgba(253, 230, 138, 0.35);
    bottom: 5%; right: 10%;
    animation-duration: 20s;
    animation-delay: -4s;
}

.dark .orb-1 { background: rgba(30, 58, 138, 0.40); }
.dark .orb-2 { background: rgba(6, 78, 59, 0.35); }
.dark .orb-3 { background: rgba(76, 29, 149, 0.35); }
.dark .orb-4 { background: rgba(120, 53, 15, 0.20); }

@keyframes floatOrb {
    0%   { transform: translate(0px, 0px) scale(1); }
    25%  { transform: translate(30px, -40px) scale(1.07); }
    50%  { transform: translate(-20px, 30px) scale(0.95); }
    75%  { transform: translate(40px, 20px) scale(1.04); }
    100% { transform: translate(0px, 0px) scale(1); }
}

/* ---- Partículas flutuantes ---- */
.particle {
    position: fixed;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    pointer-events: none;
    z-index: 1;
    animation: particleFloat linear infinite;
}

.dark .particle { background: rgba(255,255,255,0.15); }

@keyframes particleFloat {
    0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.5; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* ---- Camada de overlay semi-transparente para legibilidade ---- */
#app-overlay {
    position: fixed;
    inset: 0;
    z-index: 2;
    background: rgba(255,255,255,0.35);
    backdrop-filter: none;
    pointer-events: none;
}

.dark #app-overlay {
    background: rgba(10, 15, 30, 0.55);
}

/* ---- Header Glassmorphism ---- */
.clean-header {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 2px 24px rgba(14, 165, 233, 0.12);
    position: relative;
    z-index: 50;
}
.dark .clean-header {
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* ---- Cards Glassmorphism ---- */
.clean-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.80);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.10), 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease;
    position: relative;
    z-index: 3;
}
.clean-card:hover, .clean-card:active {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 16px 40px rgba(14, 165, 233, 0.20), 0 4px 12px rgba(0,0,0,0.08);
}
.dark .clean-card {
    background: rgba(30, 41, 59, 0.70);
    border-color: rgba(255,255,255,0.09);
}

/* ---- Botão de Emergência ---- */
.clean-danger {
    background: linear-gradient(135deg, #f87171, #ef4444, #dc2626);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.50);
    position: relative;
    overflow: hidden;
    z-index: 3;
    animation: dangerGlow 2.5s ease-in-out infinite;
}

@keyframes dangerGlow {
    0%, 100% { box-shadow: 0 6px 24px rgba(239,68,68,0.45); }
    50%       { box-shadow: 0 6px 40px rgba(239,68,68,0.75), 0 0 0 8px rgba(239,68,68,0.10); }
}

/* ---- Hero Section ---- */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 240px;
    overflow: hidden;
    border-radius: 0 0 2.5rem 2.5rem;
    margin-bottom: 1.5rem;
    z-index: 3;
}
.hero-section img.hero-bg {
    position: absolute;
    inset: 0; width: 100%; height: 100%;
    object-fit: cover;
}
.hero-section .hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom,
        rgba(14, 165, 233, 0.50) 0%,
        rgba(16, 185, 129, 0.25) 50%,
        rgba(255,255,255,0.90) 100%
    );
}
.dark .hero-section .hero-overlay {
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.50) 0%,
        rgba(15,23,42,0.70) 60%,
        rgba(15,23,42,1) 100%
    );
}
.hero-section .hero-content {
    position: relative; z-index: 4;
    padding: 2.5rem 1.5rem 1.5rem;
}

/* ---- Ken Burns: zoom lento e pan na imagem do hero ---- */
.hero-ken-burns {
    animation: kenBurns 20s ease-in-out infinite alternate;
    transform-origin: center center;
}
@keyframes kenBurns {
    0%   { transform: scale(1.0) translate(0%, 0%); }
    25%  { transform: scale(1.08) translate(-2%, -1%); }
    50%  { transform: scale(1.05) translate(2%, 1%); }
    75%  { transform: scale(1.10) translate(-1%, 2%); }
    100% { transform: scale(1.0) translate(0%, 0%); }
}

/* ---- Anel de Respiração ---- */
.breathe-ring {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 2px solid rgba(255,255,255,0.40);
    display: flex; align-items: center; justify-content: center;
    animation: breatheAnim 4s ease-in-out infinite;
}
@keyframes breatheAnim {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(255,255,255,0.30); }
    50%       { transform: scale(1.12); box-shadow: 0 0 0 20px rgba(255,255,255,0); }
}

/* ================================================================
   MONETIZAÇÃO ADSENSE — Estilos dos blocos de anúncio
   ================================================================ */

/* Container base para todos os anúncios */
.ad-wrap {
    position: relative;
    z-index: 3;
    margin: 1.25rem 0;
    width: 100%;
    overflow: hidden;
    border-radius: 1rem;
}

/* Rótulo discreto "Publicidade" acima do anúncio */
.ad-wrap::before {
    content: 'Publicidade';
    display: block;
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 4px;
}

/* Banner horizontal (topo e rodapé) */
.ad-banner {
    min-height: 90px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(14,165,233,0.12);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dark .ad-banner {
    background: rgba(30,41,59,0.55);
    border-color: rgba(148,163,184,0.12);
}

/* In-Feed (entre conteúdos) — aparência de card nativo */
.ad-infeed {
    min-height: 120px;
    background: rgba(255,255,255,0.50);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(14,165,233,0.10);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}
.dark .ad-infeed {
    background: rgba(30,41,59,0.50);
    border-color: rgba(148,163,184,0.10);
}

/* Retângulo no player (após o vídeo) */
.ad-player {
    min-height: 250px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(14,165,233,0.12);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dark .ad-player {
    background: rgba(30,41,59,0.55);
    border-color: rgba(148,163,184,0.12);
}

/* Placeholder visual para quando o AdSense ainda não está aprovado */
.ad-placeholder-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 0.75rem;
    text-align: center;
    padding: 1rem;
}
.ad-placeholder-text i { font-size: 1.5rem; opacity: 0.5; }

/* Antigo .ad-placeholder mantido por compatibilidade */
.ad-placeholder {
    width: 100%;
    min-height: 80px;
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(8px);
    border: 1px dashed rgba(14,165,233,0.35);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.75rem;
    margin: 1.25rem 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    z-index: 3;
}
.dark .ad-placeholder {
    background: rgba(30,41,59,0.55);
    border-color: rgba(148,163,184,0.20);
    color: #475569;
}

/* ---- Animação de entrada ---- */
.fade-in {
    animation: fadeIn 0.45s cubic-bezier(.34,1.2,.64,1) forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Stagger nas categorias ---- */
.slide-up { animation: slideUp 0.5s cubic-bezier(.34,1.2,.64,1) both; }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}
.slide-up:nth-child(1) { animation-delay: 0.06s; }
.slide-up:nth-child(2) { animation-delay: 0.13s; }
.slide-up:nth-child(3) { animation-delay: 0.20s; }
.slide-up:nth-child(4) { animation-delay: 0.27s; }
.slide-up:nth-child(5) { animation-delay: 0.34s; }

/* ---- Bottom Nav Glass ---- */
nav.fixed.bottom-0 {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 -4px 24px rgba(14,165,233,0.10);
    padding-bottom: env(safe-area-inset-bottom, 8px);
    z-index: 50;
}
.dark nav.fixed.bottom-0 {
    background: rgba(15,23,42,0.85);
    border-top: 1px solid rgba(255,255,255,0.07);
}

/* ---- Scrollbar oculta ---- */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---- Transition global ---- */
* { transition-property: color, background-color, border-color; transition-duration: 0.3s; }
