/* ========================================
   William O'Brien Plumbing & Heating
   Custom Styles
   ======================================== */

/* Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: rgba(199, 93, 63, 0.2);
    color: #2d2822;
}

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

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

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

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

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

@keyframes scrollLine {
    0% {
        top: -100%;
    }
    100% {
        top: 100%;
    }
}

.animate-fade-up {
    animation: fadeUp 0.8s ease-out forwards;
}

.animate-scroll-line {
    animation: scrollLine 1.5s ease-in-out infinite;
}

/* Scroll-triggered animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Navbar styles */
.nav-scrolled {
    background: rgba(250, 247, 242, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.nav-scrolled .logo-text {
    color: #2d2822 !important;
}

/* Mobile menu */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: all !important;
}

/* Hamburger animation */
.hamburger-active #bar1 {
    transform: translateY(6px) rotate(45deg);
}

.hamburger-active #bar2 {
    opacity: 0;
}

.hamburger-active #bar3 {
    transform: translateY(-6px) rotate(-45deg);
}

/* Service cards */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c75d3f, #e2987e);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

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

/* Button hover effects */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover::after {
    opacity: 1;
}

/* Form focus states */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* Image hover zoom */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.6s ease;
}

.img-zoom:hover img {
    transform: scale(1.05);
}

/* Decorative line animation */
.deco-line {
    position: relative;
}

.deco-line::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #c75d3f;
    transition: width 0.4s ease;
}

.deco-line:hover::after {
    width: 100%;
}

/* Print styles */
@media print {
    nav, #contact, footer {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}

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