/* PawHaven Core Design System & Styling */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* HSL Tailored Palettes - 'At Home Again' Branding Color Migration */
    --brand-primary: hsl(10, 78%, 57%);         /* Vibrant Terracotta Orange (#e75a3d) */
    --brand-primary-light: hsl(5, 63%, 85%);    /* Soft Rosy Peach (#f2c6c2) */
    --brand-primary-dark: hsl(8, 58%, 35%);     /* Deep Rust Chestnut (#8c3325) */
    --brand-accent: hsl(5, 63%, 85%);           /* Cozy Rose Pink (#f2c6c2) */
    --brand-accent-hover: hsl(6, 62%, 76%);     /* Soft Rose Pink Hover (#ecd1cd) */
    --brand-teal: hsl(100, 16%, 54%);           /* Organic Muted Sage Green (#859a7a) */
    --brand-teal-light: hsl(100, 20%, 94%);     /* Very Light Sage Green (#eef3eb) */
    
    /* Semantic Colors */
    --bg-main: hsl(33, 27%, 95%);               /* Warm Off-White Cream (#f7f3ee) */
    --bg-card: hsl(0, 0%, 100%);                /* Crisp White (#ffffff) */
    --text-main: hsl(8, 58%, 35%);              /* Deep Rust Chestnut (#8c3325) */
    --text-muted: hsl(10, 18%, 59%);            /* Warm Dusty Taupe (#a88d87) */
    --border-light: hsl(5, 63%, 85%);           /* Soft Rosy Peach Border (#f2c6c2) */
    
    /* Layout Tokens */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 16px -6px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 40px -15px rgba(15, 23, 42, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --container-max: 1200px;
}

/* Reset & Basics */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--brand-primary-dark);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* Layout Utilities */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 12px;
    position: relative;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--brand-primary);
    color: var(--bg-card);
}

.btn-primary:hover {
    background-color: var(--brand-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(164, 146, 203, 0.25);
}

.btn-accent {
    background-color: var(--brand-accent);
    color: var(--brand-primary-dark);
}

.btn-accent:hover {
    background-color: var(--brand-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 222, 214, 0.25);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
}

.btn-outline:hover {
    background-color: var(--brand-primary);
    color: var(--bg-card);
    transform: translateY(-2px);
}

/* Header & Navigation */
header.site-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-primary);
}

.logo span {
    color: var(--brand-accent);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 550;
    color: var(--text-main);
    position: relative;
    padding: 6px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--brand-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--brand-primary);
    transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--brand-primary);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 120px 0;
    background: linear-gradient(135deg, hsl(258, 35%, 94%) 0%, hsl(14, 45%, 93%) 100%);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 60px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.15;
}

.hero-content h1 span {
    color: var(--brand-accent);
    position: relative;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 36px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

.hero-image-wrapper {
    position: relative;
}

.hero-image {
    width: 100%;
    height: 480px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 8px solid var(--bg-card);
}

/* Counter / Stats Section */
.stats-bar {
    background-color: var(--brand-primary-dark);
    color: var(--bg-card);
    padding: 40px 0;
    margin-top: -30px;
    position: relative;
    z-index: 10;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    gap: 24px;
}

.stat-item h3 {
    font-size: 2.8rem;
    color: var(--brand-accent);
    margin-bottom: 4px;
}

.stat-item p {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
}

/* Dog Cards Grid */
.dog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.dog-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.dog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(164, 146, 203, 0.15);
}

.dog-card-image-wrapper {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.dog-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.dog-card:hover .dog-card-image {
    transform: scale(1.08);
}

.dog-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.badge-available {
    background-color: var(--brand-teal-light);
    color: var(--brand-teal);
}

.badge-pending {
    background-color: #fef3c7;
    color: #d97706;
}

.badge-adopted {
    background-color: #f3f4f6;
    color: #4b5563;
}

.dog-card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dog-card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dog-card-name {
    font-size: 1.4rem;
}

.dog-card-gender {
    font-size: 1rem;
    color: var(--text-muted);
}

.dog-card-breed {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
    font-weight: 500;
}

.dog-card-specs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.dog-card-spec-item {
    background-color: var(--bg-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--brand-primary-dark);
}

.dog-card-bio {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.dog-card-footer {
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dog-card-age {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dog-card-link {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dog-card-link:hover {
    color: var(--brand-primary-light);
    gap: 10px;
}

/* Filters Panel on dogs.php */
.filter-panel {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 40px;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--brand-primary-dark);
}

.filter-group select, .filter-group input {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: var(--bg-main);
    outline: none;
    transition: var(--transition);
}

.filter-group select:focus, .filter-group input:focus {
    border-color: var(--brand-primary-light);
    box-shadow: 0 0 0 3px rgba(164, 146, 203, 0.1);
}

.filter-actions {
    display: flex;
    gap: 12px;
}

/* Details Page (dog-details.php) */
.details-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    margin-top: 40px;
}

.details-gallery {
    position: sticky;
    top: 110px;
}

.details-gallery img {
    width: 100%;
    height: 520px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.details-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.details-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.details-name {
    font-size: 2.8rem;
}

.details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.details-meta-pill {
    padding: 8px 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-primary-dark);
}

.details-block {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.details-block h3 {
    margin-bottom: 16px;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--bg-main);
    padding-bottom: 10px;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 550;
}

.checklist-item.active {
    color: var(--brand-teal);
}

.checklist-item.inactive {
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Contact Us & Application Form */
.form-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--brand-primary-dark);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    background-color: var(--bg-main);
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--brand-primary-light);
    box-shadow: 0 0 0 3px rgba(164, 146, 203, 0.1);
}

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-weight: 500;
    font-size: 0.95rem;
}

.alert-success {
    background-color: var(--brand-teal-light);
    color: var(--brand-teal);
    border-left: 5px solid var(--brand-teal);
}

.alert-error {
    background-color: #fef2f2;
    color: #ef4444;
    border-left: 5px solid #ef4444;
}

/* Process Accordion */
.process-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.step-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 30px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 24px;
    transition: var(--transition);
}

.step-card:hover {
    transform: translateX(5px);
    border-color: var(--brand-primary-light);
}

.step-number {
    width: 60px;
    height: 60px;
    background-color: var(--brand-primary);
    color: var(--bg-card);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.step-info h3 {
    margin-bottom: 8px;
    font-size: 1.3rem;
}

/* Footer styling */
footer.site-footer {
    background-color: var(--brand-primary-dark);
    color: var(--bg-card);
    padding: 80px 0 30px;
    border-top: 8px solid var(--brand-accent);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-brand h2 {
    color: var(--bg-card);
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.footer-brand p {
    opacity: 0.75;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.footer-links h4, .footer-contact h4 {
    color: var(--brand-accent);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    opacity: 0.8;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--brand-accent);
    padding-left: 6px;
}

.footer-contact p {
    opacity: 0.8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    opacity: 0.75;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        height: 380px;
    }
    
    .details-layout {
        grid-template-columns: 1fr;
    }
    
    .details-gallery {
        position: static;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--bg-card);
        flex-direction: column;
        justify-content: center;
        gap: 30px;
        transition: var(--transition);
        z-index: 99;
        border-top: 1px solid var(--border-light);
        box-shadow: var(--shadow-md);
    }
    
    .nav-menu.open {
        left: 0;
    }
    
    .nav-actions {
        display: none; /* Relocate or hide action buttons on mobile headers */
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .step-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* --- Custom Paw Loading Animation & Donation Layouts --- */

/* SVG Paw Loader Overlay */
.paw-loader-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(74, 34, 25, 0.65); /* warm dark chocolate backdrop */
    backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.paw-loader-overlay.active {
    display: flex;
    opacity: 1;
}

.paw-svg-wrapper {
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-light);
}

.paw-svg {
    transform-origin: center;
    animation: pawBounce 1s infinite ease-in-out alternate;
}

/* Playful keyframe animations */
@keyframes pawBounce {
    0% { transform: translateY(0) scale(1) rotate(0deg); }
    100% { transform: translateY(-10px) scale(1.06) rotate(3deg); }
}

.paw-pad {
    animation: padPulse 1.6s infinite ease-in-out;
    transform-origin: center;
}

@keyframes padPulse {
    0%, 100% { fill: var(--brand-primary); opacity: 0.9; }
    50% { fill: var(--brand-primary-light); opacity: 1; }
}

.toe {
    animation: toePress 1.6s infinite ease-in-out;
    transform-origin: center;
}

.toe-1 { animation-delay: 0.1s; }
.toe-2 { animation-delay: 0.3s; }
.toe-3 { animation-delay: 0.5s; }
.toe-4 { animation-delay: 0.7s; }

@keyframes toePress {
    0%, 100% { fill: var(--brand-primary); opacity: 0.6; transform: scale(0.9); }
    50% { fill: var(--brand-accent-hover); opacity: 1; transform: scale(1.15); }
}

/* Donation UI Layout */
.donation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.donation-option-card {
    background-color: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.donation-option-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

.donation-option-card.active {
    background-color: #f7f5fa;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(164, 146, 203, 0.15);
}

.donation-amount-badge {
    background-color: var(--brand-primary);
    color: var(--bg-card);
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    padding: 6px 18px;
    border-radius: var(--radius-full);
    line-height: 1;
}

.donation-option-card.active .donation-amount-badge {
    background-color: var(--brand-primary-dark);
}

.donation-option-card h4 {
    font-size: 1.1rem;
    color: var(--brand-primary-dark);
    margin: 0;
}

.donation-option-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

/* Donation Success Screen */
.donation-success-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    text-align: center;
    max-width: 520px;
    margin: 40px auto;
    animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.donation-success-icon {
    width: 64px;
    height: 64px;
    background-color: var(--brand-teal-light);
    color: var(--brand-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 768px) {
    .donation-grid {
        grid-template-columns: 1fr;
    }
}
