/* ========================================
   Rocha & Meireles Advocacia - Custom Styles
   ======================================== */

/* Justify all paragraphs */
p {
    text-align: justify;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Selection Color */
::selection {
    background-color: #f0ab2d;
    color: #fff;
}

/* ========== Hero Pattern ========== */
.hero-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f0ab2d' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.animation-delay-100 {
    animation-delay: 0.1s;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-300 {
    animation-delay: 0.3s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

/* ========== Scroll Animations ========== */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animation */
.scroll-animate:nth-child(2) {
    transition-delay: 0.1s;
}

.scroll-animate:nth-child(3) {
    transition-delay: 0.2s;
}

.scroll-animate:nth-child(4) {
    transition-delay: 0.15s;
}

.scroll-animate:nth-child(5) {
    transition-delay: 0.2s;
}

.scroll-animate:nth-child(6) {
    transition-delay: 0.25s;
}

/* ========== Header ========== */
.header-scrolled {
    background-color: rgba(58, 75, 51, 0.97) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.header-scrolled .nav-link {
    color: #e5e7eb;
}

/* ========== Service Cards ========== */
.service-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.service-card:hover {
    transform: translateY(-8px);
}

/* ========== WhatsApp FAB pulse ========== */
#whatsapp-fab {
    animation: fabPulse 2s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
}

/* ========== Form Focus ========== */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(240, 171, 45, 0.15);
}

/* ========== Custom Scrollbar ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #3A4B33;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f0ab2d;
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 768px) {
    .hero-pattern {
        opacity: 0.03;
    }

    #whatsapp-fab {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
    }

    #whatsapp-fab svg {
        width: 28px;
        height: 28px;
    }

    #back-to-top {
        right: 80px;
        bottom: 16px;
        width: 40px;
        height: 40px;
    }
}

/* ========== Loading spinner for form ========== */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* ========== Print Styles ========== */
@media print {
    header,
    #whatsapp-fab,
    #back-to-top,
    .scroll-indicator {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
    }
}