/* ===================================
   AMEDIS - Estilos Principais
   Associação Medicinal de Direito à Saúde
   =================================== */

/* ===== VARIÁVEIS CSS ===== */
:root {
    /* Cores Primárias AMEDIS */
    --primary-green: #028136;
    --primary-green-light: #16a34a;
    --primary-green-dark: #15803d;
    
    /* Cores Neutras */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Cores de Acento */
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --orange-500: #f97316;
    --purple-500: #a855f7;
    
    /* Espaçamento */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-3xl: 0 35px 60px -15px rgb(0 0 0 / 0.3);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
}

/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Ubuntu', sans-serif;
    background-color: #f4f4f4;
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-display: swap;
}

html {
    scroll-behavior: smooth;
    visibility: visible;
    opacity: 1;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== UTILITÁRIOS ===== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light), var(--primary-green-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.shadow-3xl {
    box-shadow: var(--shadow-3xl);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== BOTÕES ===== */
.btn-primary {
    background: var(--primary-green);
    color: var(--white);
    padding: 0.75rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--primary-green-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== SEÇÕES ===== */
section {
    padding: 5rem 1.5rem;
}

/* ===== HEADER ===== */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem 0;
}

#header .header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#header.scrolled {
    padding: 0;
    transform: translateZ(0);
}

#header.scrolled .header-inner {
    max-width: 100%;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 2rem;
}

.nav-link {
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-green);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-green);
}

.nav-link.active::after {
    width: 100%;
}

/* ===== HERO SLIDESHOW ===== */
@media only screen and (max-width: 991px) {
    .slideshow-container {
        height: 40vh;
    }
}
@media only screen and (min-width: 992px) {
    .slideshow-container {
        height: 80vh;
    }
}
.slideshow-container {
    position: relative;
    top: -30px;
    width: 100%;

    overflow: hidden;
    border-radius: 40px;
}

#atuacao {
    position: relative;
}

.slide-overlay::after, 
#atuacao::after, 
#pagesTitle::after {
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    width: 100%;
    height: 18px;
    background-image: url(../assets/images/arestas_yellow.webp);
    background-size: contain;
    background-repeat: repeat-x;
    z-index: 1;
}

.slide-overlay::before, 
#atuacao::before {
    position: absolute;
    content: "";
    left: 0;
    bottom: 0;
    width: 100%;
    height: 18px;
    background-image: url(../assets/images/arestas_yellow.webp);
    background-size: contain;
    background-repeat: repeat-x;
    z-index: 1;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 0;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    transition: transform 8s ease-out;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.slide.active .slide-image {
    transform: scale(1);
}

.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.5),
        rgba(0, 0, 0, 0.8)
    );
    z-index: 1;
}

.slide-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 2rem;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px);
}

.slide.active .slide-content {
    animation: slideUp 0.8s ease-out forwards;
    animation-delay: 0.3s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-title {
    font-size: 3.75rem;
    line-height: normal;
    font-weight: 700;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slide-description {
    font-size: 1.25rem;
    max-width: 800px;
    margin-bottom: 2rem;
    line-height: 1.8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.slide-cta {
    background: var(--primary-green);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.slide-cta:hover {
    background: var(--primary-green-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.slide-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
    border: none;
}

.slide-control.prev {
    left: 2rem;
}

.slide-control.next {
    right: 2rem;
}

.slide-control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.slide-indicators {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 3;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.indicator.active {
    background: white;
    width: 32px;
    border-radius: 6px;
}

/* ===== SERVICE CARDS ===== */
.service-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
    isolation: isolate;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-green-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-12px) scale(1.02) translateZ(0);
    box-shadow: 0 20px 40px rgba(2, 129, 54, 0.15);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:focus-within {
    outline: 2px solid var(--primary-green);
    outline-offset: 4px;
}

.service-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.service-card:hover .service-icon {
    transform: scale(1.15) rotate(8deg);
    background: linear-gradient(135deg, #bbf7d0, #86efac);
    box-shadow: 0 8px 16px rgba(2, 129, 54, 0.2);
}

.service-icon i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .service-icon i {
    transform: rotate(-8deg);
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.service-card:hover .service-title {
    color: var(--primary-green);
}

.service-description {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.7;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-section:not(.visible) .service-card {
    animation-play-state: paused;
}

.fade-in-section.visible .service-card {
    animation-play-state: running;
}

/* ===== ESTATÍSTICAS ===== */
.stat-box {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

#atuacao img {
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== PARTNER CARDS ===== */
.partner-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
    isolation: isolate;
}

.partner-card:nth-child(1) { animation-delay: 0.1s; }
.partner-card:nth-child(2) { animation-delay: 0.2s; }
.partner-card:nth-child(3) { animation-delay: 0.3s; }

/* ===== MODAIS ===== */
.modal-overlay {
    backdrop-filter: blur(8px);
}

body.modal-open {
    overflow: hidden;
}

.flex-1.overflow-y-auto {
    min-height: 200px;
}

/* ===== VIDEO MODAL ===== */
.video-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 1rem;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.video-modal-overlay.active .video-modal-content {
    transform: scale(1);
}

.video-modal-close {
    position: absolute;
    top: -3rem;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    z-index: 10;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.video-modal-content video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===== CTA SECTION ===== */
#cta-associado {
    position: relative;
}

#cta-associado a {
    position: relative;
    overflow: hidden;
}

#cta-associado a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#cta-associado a:hover::before {
    width: 300px;
    height: 300px;
}

/* ===== OTIMIZAÇÕES DE PERFORMANCE ===== */
.slide,
.slide-image,
.slide-content,
.service-card,
.partner-card,
.btn-primary,
.slide-control,
.indicator {
    will-change: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.slide.active,
.service-card:hover,
.partner-card:hover,
.btn-primary:hover {
    will-change: transform, opacity;
}

* {
    -webkit-overflow-scrolling: touch;
}

#header,
#home,
section {
    contain: layout style;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.flex {
    display: flex;
}

button,
.btn-primary,
.slide-control,
.indicator {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

[x-show] {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
