/**
 * ============================================
 * 🎨 Macedo Advocacia - Organized CSS
 * Vilhena/RO - Clean Architecture
 * Version: 2.0.0
 * ============================================
 * 
 * TABLE OF CONTENTS:
 * 1. CSS Custom Properties
 * 2. Base Reset
 * 3. Glassmorphism Effects
 * 4. Typography & Text Effects
 * 5. Animations & Keyframes
 * 6. Reveal & Scroll Effects
 * 7. Header & Navigation
 * 8. Buttons & Interactive
 * 9. FAQ Accordion
 * 10. Cities Marquee
 * 11. Image Effects
 * 12. Scrollbar
 * 13. Accessibility
 * 14. Responsive Design
 * 15. Print Styles
 */

/* ============================================
   1. CSS CUSTOM PROPERTIES
   ============================================ */

:root {
    /* Brand Colors */
    --gold: #b49260;
    --gold-light: #d4af37;
    --gold-glow: rgba(180, 146, 96, 0.4);

    /* Neutrals */
    --black: #050505;
    --dark: #0a0a0a;
    --stone: #1a1a1a;

    /* Glass Effect Colors */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(180, 146, 96, 0.3);

    /* Shadows */
    --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-gold: 0 0 40px rgba(180, 146, 96, 0.1);

    /* Transitions */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --duration-fast: 0.2s;
    --duration-normal: 0.4s;
    --duration-slow: 0.6s;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;
}

/* ============================================
   2. BASE RESET
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   3. GLASSMORPHISM EFFECTS
   ============================================ */

.glass-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow:
        var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    transition: all var(--duration-slow) var(--ease-smooth);
}

.glass-card:hover {
    background: linear-gradient(135deg,
            var(--glass-bg-hover) 0%,
            rgba(180, 146, 96, 0.05) 50%,
            var(--glass-bg-hover) 100%);
    border-color: var(--glass-border-hover);
    box-shadow:
        var(--shadow-lg),
        var(--shadow-gold),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.glass-panel {
    background: linear-gradient(180deg,
            rgba(10, 10, 10, 0.7) 0%,
            rgba(10, 10, 10, 0.5) 100%);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ============================================
   4. TYPOGRAPHY & TEXT EFFECTS
   ============================================ */

/* Text Shine Effect - Compatível com Safari/iOS */
.text-shine {
    /* Fallback: cor sólida caso o efeito não funcione */
    color: var(--gold);

    /* Efeito gradiente animado */
    background: linear-gradient(120deg,
            var(--gold) 0%,
            #e8c48a 20%,
            var(--gold) 40%,
            #fff 50%,
            var(--gold) 60%,
            #e8c48a 80%,
            var(--gold) 100%);
    background-size: 300% auto;

    /* Clip do texto - ordem importa para Safari */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    /* Animação */
    animation: textShine 8s ease-in-out infinite;
}

/* Fallback para navegadores que não suportam background-clip: text */
@supports not (-webkit-background-clip: text) {
    .text-shine {
        background: none;
        -webkit-text-fill-color: var(--gold);
        color: var(--gold);
    }
}

/* ============================================
   5. ANIMATIONS & KEYFRAMES
   ============================================ */

@keyframes textShine {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(180, 146, 96, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(180, 146, 96, 0.6), 0 0 60px rgba(180, 146, 96, 0.3);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(1deg);
    }

    50% {
        transform: translateY(-20px) rotate(0deg);
    }

    75% {
        transform: translateY(-10px) rotate(-1deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    10%,
    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation Classes */
.glow-pulse {
    animation: glowPulse 3s ease-in-out infinite;
}

.fade-in-up {
    animation: fadeInUp 0.8s var(--ease-smooth) forwards;
}

/* Stagger Delays */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

/* ============================================
   6. REVEAL & SCROLL EFFECTS
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s var(--ease-smooth);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.hover-lift {
    transition:
        transform var(--duration-normal) var(--ease-bounce),
        box-shadow var(--duration-normal) var(--ease-smooth);
}

.hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.magnetic {
    transition: transform 0.3s var(--ease-smooth);
}

/* Particles */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 15s infinite ease-in-out;
}

/* ============================================
   7. HEADER & NAVIGATION
   ============================================ */

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
    z-index: 10001;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--gold-glow), 0 0 20px rgba(180, 146, 96, 0.3);
}

/* Default Header - stays at top normally */
#main-header {
    transition: all 0.5s var(--ease-smooth);
}

/* Floating Glass Header - only when scrolled (Desktop) */
@media (min-width: 1024px) {
    .header-scrolled {
        top: 0.75rem !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 3rem) !important;
        max-width: 1400px;
        border-radius: 1rem;
        background: rgba(5, 5, 5, 0.75) !important;
        backdrop-filter: blur(30px) saturate(180%);
        -webkit-backdrop-filter: blur(30px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 0 30px rgba(180, 146, 96, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .header-scrolled:hover {
        background: rgba(5, 5, 5, 0.85) !important;
        border-color: rgba(180, 146, 96, 0.2);
        box-shadow:
            0 12px 40px rgba(0, 0, 0, 0.5),
            0 0 40px rgba(180, 146, 96, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
}

/* Default Header Scrolled (Mobile/Tablet) */
@media (max-width: 1023px) {
    .header-scrolled {
        background: rgba(5, 5, 5, 0.95) !important;
        backdrop-filter: blur(30px) saturate(180%);
        -webkit-backdrop-filter: blur(30px) saturate(180%);
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    }
}

.header-scrolled #header-logo {
    height: 2.5rem !important;
}

/* Mobile Menu */
#mobile-menu {
    background: rgba(5, 5, 5, 0.98) !important;
    z-index: 100 !important;
}

#mobile-menu.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

#mobile-menu.active .mobile-link {
    animation: slideInRight 0.5s var(--ease-smooth) forwards;
    opacity: 0;
}

#mobile-menu.active .mobile-link:nth-child(1) {
    animation-delay: 0.1s;
}

#mobile-menu.active .mobile-link:nth-child(2) {
    animation-delay: 0.15s;
}

#mobile-menu.active .mobile-link:nth-child(3) {
    animation-delay: 0.2s;
}

#mobile-menu.active .mobile-link:nth-child(4) {
    animation-delay: 0.25s;
}

#mobile-menu.active .mobile-link:nth-child(5) {
    animation-delay: 0.3s;
}

#mobile-menu.active .mobile-link:nth-child(6) {
    animation-delay: 0.35s;
}

/* ============================================
   8. BUTTONS & INTERACTIVE
   ============================================ */

.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-slow) var(--ease-smooth);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--gold-glow);
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width var(--duration-slow), height var(--duration-slow), opacity var(--duration-slow);
    opacity: 0;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
    opacity: 0;
}

/* ============================================
   9. FAQ ACCORDION
   ============================================ */

.faq-item {
    transition: all var(--duration-normal) var(--ease-smooth);
}

.faq-item:hover {
    border-color: var(--glass-border-hover);
}

.faq-item.active {
    background: linear-gradient(135deg,
            rgba(180, 146, 96, 0.1) 0%,
            rgba(255, 255, 255, 0.02) 100%);
    border-color: rgba(180, 146, 96, 0.4);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: var(--gold);
}

.faq-item.active .faq-question {
    color: var(--gold);
}

.faq-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition:
        max-height 0.5s var(--ease-smooth),
        opacity var(--duration-normal) var(--ease-smooth);
}

.faq-item.active .faq-content {
    max-height: 500px;
    opacity: 1;
}

/* ============================================
   10. CITIES MARQUEE
   ============================================ */

.cities-marquee {
    animation: scroll 40s linear infinite;
}

.cities-marquee:hover {
    animation-play-state: paused;
}

/* ============================================
   11. IMAGE EFFECTS
   ============================================ */

.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition:
        transform 0.8s var(--ease-smooth),
        filter 0.5s var(--ease-smooth);
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

/* ============================================
   12. SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--black);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold) 0%, #8a6d42 100%);
    border-radius: 5px;
    border: 2px solid var(--black);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gold) var(--black);
}

/* ============================================
   13. ACCESSIBILITY
   ============================================ */

/* Improved Contrast */
.text-slate-400 {
    color: #a8a8a8 !important;
}

.text-slate-300 {
    color: #c8c8c8 !important;
}

.text-slate-500 {
    color: #8a8a8a !important;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .parallax-bg {
        transform: none !important;
    }

    .cities-marquee {
        animation: none !important;
    }

    .text-shine {
        animation: none !important;
        background: var(--gold) !important;
        -webkit-text-fill-color: var(--gold) !important;
    }

    .glow-pulse {
        animation: none !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Focus Styles */
:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(180, 146, 96, 0.25);
}

.faq-item:focus-within {
    border-color: rgba(180, 146, 96, 0.5);
    box-shadow: 0 0 0 4px rgba(180, 146, 96, 0.15);
}

/* Skip Link */
.skip-link {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--black);
    padding: 1rem 2rem;
    z-index: 10000;
    transition: top 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 0;
    outline: none;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --gold: #ffc107;
        --gold-light: #ffd54f;
        --glass-border: rgba(255, 255, 255, 0.3);
    }

    .glass-card,
    .glass-panel {
        border-width: 2px;
        border-color: rgba(255, 255, 255, 0.5);
    }

    .text-slate-400,
    .text-slate-300 {
        color: #fff !important;
    }

    body {
        background: #000 !important;
    }
}

/* Forced Colors (Windows High Contrast) */
@media (forced-colors: active) {

    .glass-card,
    .glass-panel,
    .btn-primary {
        border: 2px solid CanvasText;
    }

    :focus-visible {
        outline: 3px solid Highlight;
    }
}

/* Touch Targets */
@media (pointer: coarse) {

    a,
    button,
    [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    .faq-item button {
        min-height: 56px;
    }
}

/* Selection */
::selection {
    background: var(--gold);
    color: var(--black);
}

/* ============================================
   14. RESPONSIVE DESIGN
   ============================================ */

/* Mobile */
@media (max-width: 768px) {
    .glass-card {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .glass-card:hover {
        transform: translateY(-2px);
    }

    .parallax-bg {
        transform: none !important;
    }

    /* Fallback: Desabilita animação do text-shine em mobile para garantir visibilidade */
    .text-shine {
        animation: none !important;
        background: linear-gradient(120deg, var(--gold) 0%, #e8c48a 50%, var(--gold) 100%) !important;
        background-size: 100% auto !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        background-clip: text !important;
        color: var(--gold) !important;
        /* Fallback final */
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .glass-card {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

/* Large Screens */
@media (min-width: 1440px) {
    .container-wide {
        max-width: 1400px;
    }
}

/* ============================================
   15. PRINT STYLES
   ============================================ */

@media print {

    .glass-card,
    .glass-panel {
        background: #fff !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    header,
    #mobile-menu,
    .whatsapp-float,
    .skip-link,
    .particles,
    .custom-cursor {
        display: none !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}