/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'CatFont';
    src: url('https://fonts.googleapis.com/css2?family=Bubblegum+Sans&display=swap');
}

body {
    font-family: 'Bubblegum Sans', 'CatFont', sans-serif;
    line-height: 1.6;
    color: #4a4a4a;
    background-color: #fff5f7;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 動態背景 - 貓爪效果 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('flower.png') repeat;
    background-size: 200px;
    opacity: 0.05;
    z-index: -2;
}

/* 飄動的貓咪氣球效果 */
.clouds {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('flower2.png') repeat-x;
    background-size: 500px;
    opacity: 0.1;
    z-index: -1;
    animation: cloudMove 60s linear infinite;
}

@keyframes cloudMove {
    from {
        background-position: 0% 0%;
    }
    to {
        background-position: 100% 0%;
    }
}

/* YouTube影片區塊樣式 */
.youtube-section {
    margin: 40px auto;
    text-align: center;
    width: 100%;
    max-width: 1200px; /* 與services區塊相同的寬度 */
    padding: 0 20px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 100%; /* 確保不超過父容器 */
    margin: 0 auto; /* 居中顯示 */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* 飄落的魚骨頭 */
.petals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.petal {
    position: absolute;
    background-image: url('flower2.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
    opacity: 0.7;
    animation: petalFall linear infinite;
}

@keyframes petalFall {
    0% {
        transform: translateY(-5%) rotate(0deg);
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.2);
    border: 3px dashed #ffb6c1;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    transition: transform 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border: 3px solid white;
}

/* 頁頭樣式 */
header {
    text-align: center;
    margin-bottom: 50px;
    padding: 30px 0;
    position: relative;
    border-bottom: 3px dotted #ffb6c1;
}

/* 貓耳朵裝飾 */
header::before, header::after {
    content: "";
    position: absolute;
    top: -20px;
    width: 50px;
    height: 50px;
    background: #ffb6c1;
    border-radius: 50% 50% 0 0;
    z-index: -1;
}

header::before {
    left: calc(50% - 80px);
    transform: rotate(-30deg);
}

header::after {
    right: calc(50% - 80px);
    transform: rotate(30deg);
}

header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ff6b88;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #fff, 3px 3px 0 #ffb6c1;
    position: relative;
    display: inline-block;
    padding: 0 20px;
}

header h1::before, header h1::after {
    content: '🐾';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #ff6b88;
    font-size: 1.5rem;
}

header h1::before {
    left: -10px;
}

header h1::after {
    right: -10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #888;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
    padding: 0 30px;
}

.subtitle::before, .subtitle::after {
    content: '🐱';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.subtitle::before {
    left: 0;
}

.subtitle::after {
    right: 0;
}

/* 服務區塊樣式 */
.services {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 60px;
}

.service-item {
    flex: 0 0 calc(33.333% - 30px);
    min-width: 280px;
    background-color: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.15);
    transition: all 0.5s ease;
    aspect-ratio: 1/1.2;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 3px solid #ffb6c1;
}

.service-item::before {
    content: '🐾';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    z-index: 10;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.service-item:hover::before {
    transform: rotate(15deg) scale(1.2);
    opacity: 1;
}

.service-item:hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 15px 30px rgba(255, 105, 180, 0.25);
}

.service-image {
    overflow: hidden;
    position: relative;
    flex-grow: 1;
    width: 100%;
    height: 100%;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    filter: brightness(1.05);
    border-radius: 15px 15px 0 0;
    border: none;
}

.service-item:hover .service-image img {
    transform: scale(1.05);
}

/* 貓咪風格裝飾元素 */
.service-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: url('https://i.imgur.com/nJYfA9H.png') repeat-x;
    background-size: 40px;
    opacity: 0.3;
    z-index: 1;
}

.service-title {
    padding: 15px;
    text-align: center;
    background: #fff;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    transition: all 0.4s ease;
    border-top: 3px dotted #ffb6c1;
}

.service-item:hover .service-title {
    background: #fff5f7;
    padding-top: 20px;
    padding-bottom: 20px;
}

.service-title h2 {
    font-size: 1.6rem;
    color: #ff6b88;
    margin: 0;
    position: relative;
    display: inline-block;
    font-weight: 700;
}

.service-title h2::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -5px;
    left: 50%;
    background: #ffb6c1;
    transition: all 0.4s ease;
    transform: translateX(-50%);
    border-radius: 10px;
}

.service-item:hover .service-title h2::after {
    width: 80%;
}

/* 客戶見證區塊樣式 */
.testimonials {
    margin-bottom: 60px;
    position: relative;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 40px;
    color: #ff6b88;
    position: relative;
    padding-bottom: 15px;
}

.star-icon {
    color: #ffb6c1;
    margin: 0 10px;
    font-size: 1.5rem;
    display: inline-block;
}

.section-title::before {
    content: '🐱';
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 5px;
    background: url('https://i.imgur.com/nJYfA9H.png') repeat-x;
    background-size: 20px;
    opacity: 0.5;
}

.testimonial-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.testimonial-item {
    flex: 0 0 calc(33.333% - 20px);
    min-width: 250px;
    background-color: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.15);
    transition: all 0.3s ease;
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 3px solid #ffb6c1;
}

.testimonial-item:hover {
    transform: translateY(-5px) rotate(-1deg);
    box-shadow: 0 10px 25px rgba(255, 105, 180, 0.25);
}

.testimonial-image {
    overflow: hidden;
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: 100%;
}

.testimonial-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(1.05);
    border-radius: 15px 15px 0 0;
    border: none;
}

.testimonial-item:hover .testimonial-image img {
    transform: scale(1.05);
}

.testimonial-text {
    padding: 15px;
    text-align: center;
    background: #fff;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    border-top: 3px dotted #ffb6c1;
}

.testimonial-text p {
    font-size: 1rem;
    color: #888;
    margin: 0;
}

.testimonial-text::before {
    content: '🐾';
    display: block;
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #ffb6c1;
}

/* 簡介和聯繫方式區塊樣式 */
.intro-contact {
    background-color: #fff;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 60px;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.15);
    position: relative;
    border: 3px dashed #ffb6c1;
}

.intro-contact::before {
    content: '🐱';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    background: #fff;
    padding: 0 15px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #ffb6c1;
}

.intro {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

.intro h2 {
    font-size: 2rem;
    color: #ff6b88;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.intro h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #ffb6c1;
    border-radius: 10px;
}

.intro p {
    font-size: 1.1rem;
    color: #888;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.contact-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
    transition: all 0.3s ease;
    min-width: 180px;
    border: none;
    position: relative;
    overflow: hidden;
}

.contact-btn::before {
    content: '🐾';
    position: absolute;
    left: 15px;
    font-size: 1.2rem;
}

.contact-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.line-btn {
    background: #ff6b88;
}

.website-btn {
    background: #ffb6c1;
}

.email-btn {
    background: #ff8fa3;
}

.contact-btn span {
    margin-left: 20px;
}

/* 頁尾樣式 */
footer {
    text-align: center;
    padding: 30px 0;
    color: #888;
    font-size: 0.9rem;
    border-top: 3px dotted #ffb6c1;
    margin-top: 30px;
    position: relative;
}

footer::before {
    content: '🐾 🐾 🐾';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 0 15px;
    color: #ffb6c1;
}

/* 動畫相關樣式 */
.animate__animated {
    opacity: 0;
}

/* 確保 a 標籤覆蓋整個服務項目和見證項目 */
.service-item a, .testimonial-item a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 5;
}

/* 貓咪風格裝飾元素 */
.corner-decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    background: url('https://i.imgur.com/3VVimr1.png') no-repeat;
    background-size: contain;
    opacity: 0.7;
    z-index: 10;
}

.corner-top-left {
    top: 5px;
    left: 5px;
    transform: rotate(-30deg);
}

.corner-top-right {
    top: 5px;
    right: 5px;
    transform: rotate(30deg);
}

.corner-bottom-left {
    bottom: 5px;
    left: 5px;
    transform: rotate(-120deg);
}

.corner-bottom-right {
    bottom: 5px;
    right: 5px;
    transform: rotate(120deg);
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .service-item {
        flex: 0 0 calc(50% - 30px);
    }
    
    .testimonial-item {
        flex: 0 0 calc(50% - 20px);
    }
    
    header h1 {
        font-size: 3rem;
    }
    
    .intro p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
	.youtube-section {
        padding: 0 15px; /* 在小螢幕上減少內邊距 */
    }
	.video-container {
        max-width: 80%; /* 在較大螢幕上使用更合理的寬度 */
    }
    .services {
        gap: 20px;
    }
    
    .service-item {
        flex: 0 0 100%;
        max-width: 450px;
        margin: 0 auto;
    }
    
    .testimonial-item {
        flex: 0 0 calc(50% - 20px);
    }
    
    .contact-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-btn {
        width: 100%;
        max-width: 300px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .intro-contact {
        padding: 30px 20px;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .testimonial-item {
        flex: 0 0 100%;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .service-title h2 {
        font-size: 1.4rem;
    }
    
    .star-icon {
        font-size: 1.2rem;
    }
    
    .intro h2 {
        font-size: 1.8rem;
    }
    
    .intro p {
        font-size: 1rem;
    }
    
    .contact-btn {
        font-size: 1rem;
        padding: 12px 25px;
    }
}

/* 貓咪動畫效果 */
@keyframes catTail {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(10deg);
    }
}

.service-item::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    width: 30px;
    height: 60px;
    background: url('https://i.imgur.com/X2d5VTF.png') no-repeat center center;
    background-size: contain;
    transform-origin: top center;
    animation: catTail 2s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.service-item:hover::after {
    opacity: 0.7;
}

/* 生成魚骨頭的 JavaScript */
document.addEventListener('DOMContentLoaded', function() {
    const petalsContainer = document.createElement('div');
    petalsContainer.className = 'petals';
    document.body.appendChild(petalsContainer);
    
    function createPetal() {
        const petal = document.createElement('div');
        petal.className = 'petal';
        petal.style.left = Math.random() * 100 + 'vw';
        petal.style.opacity = Math.random() * 0.6 + 0.3;
        petal.style.width = Math.random() * 15 + 10 + 'px';
        petal.style.height = petal.style.width;
        
        const duration = Math.random() * 10 + 8;
        petal.style.animationDuration = duration + 's';
        petal.style.transform = `rotate(${Math.random() * 360}deg)`;
        
        petalsContainer.appendChild(petal);
        
        setTimeout(() => {
            petal.remove();
        }, duration * 1000);
    }
    
    // 初始創建一些魚骨頭
    for (let i = 0; i < 10; i++) {
        setTimeout(createPetal, i * 300);
    }
    
    // 持續創建魚骨頭
    setInterval(createPetal, 1000);
});
