/* Custom CSS for Smith Family Law Website */

/* Font Setup */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Mobile Menu Animations */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

.mobile-menu-enter {
    animation: slideDown 0.3s ease-out;
}

.mobile-menu-exit {
    animation: slideUp 0.3s ease-in;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.animate,
.fade-in-left.animate,
.fade-in-right.animate {
    opacity: 1;
    transform: translate(0, 0);
}

/* Hero Button Animations */
.hero-btn {
    transition: all 0.3s ease;
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.hero-btn:active {
    transform: translateY(0);
}

/* Practice Areas Animation */
.practice-area {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.practice-area.animate {
    opacity: 1;
    transform: translateY(0);
}

.practice-area:hover {
    transform: translateY(-5px);
}

/* Resource Cards Animation */
.resource-card {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.3s ease;
}

.resource-card.animate {
    opacity: 1;
    transform: translateY(0);
}

.resource-card:hover {
    transform: translateY(-3px);
}

/* Form Animations */
#contact-form {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

#contact-form.animate {
    opacity: 1;
    transform: translateX(0);
}

/* Form Input Focus Effects */
input:focus,
textarea:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Button Hover Effects */
button {
    transition: all 0.2s ease;
}

button:hover {
    transform: scale(1.05);
}

button:active {
    transform: scale(0.98);
}

/* Navigation Active States */
.nav-link.active {
    color: #0f172a !important;
    font-weight: 600;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #0f172a;
    border-radius: 1px;
}

/* Success Message Animation */
#form-success {
    animation: fadeInScale 0.5s ease-out;
}

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

/* Hero Image Animation */
.hero-image {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    animation-delay: 0.2s;
}

.hero-image.animate {
    opacity: 1;
    transform: translateX(0);
}

/* Hero Text Animation */
.hero-text {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.hero-text.animate {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger Animation for Practice Areas */
.practice-area:nth-child(1) { transition-delay: 0s; }
.practice-area:nth-child(2) { transition-delay: 0.1s; }
.practice-area:nth-child(3) { transition-delay: 0.2s; }
.practice-area:nth-child(4) { transition-delay: 0.3s; }

/* Stagger Animation for Resource Cards */
.resource-card:nth-child(1) { transition-delay: 0s; }
.resource-card:nth-child(2) { transition-delay: 0.1s; }
.resource-card:nth-child(3) { transition-delay: 0.2s; }
.resource-card:nth-child(4) { transition-delay: 0.3s; }

/* Header Scroll Effect */
#header {
    transition: all 0.3s ease;
}

#header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

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

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #94a3b8;
    border-top: 2px solid #0f172a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .hero-btn {
        width: 100%;
        justify-content: center;
    }
    
    .practice-area {
        margin-bottom: 1rem;
    }
    
    .resource-card {
        margin-bottom: 1rem;
    }
}

/* Focus Visible for Accessibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .hero-btn,
    #mobile-menu-btn,
    #mobile-menu {
        display: none;
    }
    
    * {
        background: white !important;
        color: black !important;
    }
}