/* 頭重溪三元宮官網 - 高端活潑設計版 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&family=Noto+Serif+TC:wght@400;700&display=swap');

:root {
    --primary-red: #D4380D;
    --primary-red-light: #FF6B3D;
    --primary-red-dark: #9A1B00;
    --gold: #FFB800;
    --gold-light: #FFD54F;
    --cream: #FFF8F0;
    --dark: #1A1A2E;
    --teal: #0D9488;
    --purple: #7C3AED;
    --gradient-1: linear-gradient(135deg, #D4380D 0%, #FF6B3D 50%, #FFB800 100%);
    --gradient-2: linear-gradient(135deg, #1A1A2E 0%, #2D2D44 100%);
    --gradient-3: linear-gradient(135deg, #FFB800 0%, #FFD54F 100%);
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-medium: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 40px rgba(212, 56, 13, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* ===== 導覽列 ===== */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 30px rgba(0,0,0,0.08);
    padding: 15px 0;
    transition: all 0.4s ease;
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 4px 40px rgba(0,0,0,0.15);
}

.navbar-brand {
    font-weight: 900;
    font-size: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    -webkit-text-fill-color: initial;
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--dark);
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: var(--primary-red);
    background: rgba(212, 56, 13, 0.08);
}

.navbar-dark .navbar-nav .nav-link.active {
    color: white;
    background: var(--gradient-1);
}

.nav-item.dropdown .nav-link::after {
    display: inline-block;
    margin-left: 5px;
    content: '';
    border: none;
}

.dropdown-menu {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-medium);
    padding: 15px;
    background: white;
}

.dropdown-item {
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--gradient-1);
    color: white;
    transform: translateX(5px);
}

/* ===== Hero 區塊 ===== */
.hero-section {
    position: relative;
    background: var(--gradient-2);
    min-height: 85vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: white;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.05)"/><circle cx="80" cy="40" r="3" fill="rgba(255,255,255,0.03)"/><circle cx="40" cy="80" r="2" fill="rgba(255,255,255,0.04)"/><circle cx="70" cy="70" r="1.5" fill="rgba(255,255,255,0.03)"/></svg>');
    background-size: 200px 200px;
    animation: heroFloat 20s linear infinite;
}

@keyframes heroFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-200px); }
}

.hero-decoration {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: var(--gradient-1);
    filter: blur(150px);
    opacity: 0.3;
    animation: pulse 4s ease-in-out infinite;
}

.hero-decoration-1 {
    top: -100px;
    right: -100px;
}

.hero-decoration-2 {
    bottom: -150px;
    left: -100px;
    background: var(--teal);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.4; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-section h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.hero-section h1 .highlight {
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section p {
    font-size: 1.4rem;
    opacity: 0.9;
    margin-bottom: 40px;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero-primary {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.4s ease;
    box-shadow: 0 10px 40px rgba(212, 56, 13, 0.4);
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(212, 56, 13, 0.5);
    color: white;
}

.btn-hero-secondary {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 14px 38px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.4s ease;
}

.btn-hero-secondary:hover {
    background: white;
    color: var(--dark);
    border-color: white;
    transform: translateY(-3px);
}

/* 浮動裝飾元素 */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    font-size: 3rem;
    opacity: 0.15;
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.floating-element:nth-child(2) { top: 60%; left: 5%; animation-delay: 1s; }
.floating-element:nth-child(3) { top: 30%; right: 10%; animation-delay: 2s; }
.floating-element:nth-child(4) { top: 70%; right: 8%; animation-delay: 3s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* ===== 卡片樣式 ===== */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s ease;
    background: white;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-glow);
}

.card-img-top {
    height: 220px;
    object-fit: cover;
}

.card-body {
    padding: 25px;
}

.card-title {
    color: var(--dark);
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.card-text {
    color: #666;
    line-height: 1.7;
}

/* 活動卡片 */
.activity-card {
    cursor: pointer;
    position: relative;
}

.activity-card .card-img-top {
    height: 200px;
}

.activity-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

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

.activity-card .badge {
    background: var(--gradient-1);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

/* ===== 照片燈箱 ===== */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-item:hover img {
    transform: scale(1.1);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(26, 26, 46, 0.9));
    color: white;
    padding: 40px 20px 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

/* ===== 最新消息 ===== */
.news-thumb {
    max-height: 100px;
    max-width: 140px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(212, 56, 13, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    border-color: var(--primary-red);
}

.news-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 12px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    transition: transform 0.3s;
}

.lightbox-close:hover {
    transform: rotate(90deg);
}

/* ===== 頁尾 ===== */
.footer {
    background: var(--gradient-2);
    color: white;
    padding: 80px 0 30px;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
}

.footer h5 {
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.footer h5::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--gradient-1);
    border-radius: 2px;
}

.footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer a:hover {
    color: var(--gold) !important;
    transform: translateX(5px);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links li a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--gradient-1);
    transform: translateY(-5px);
}

/* ===== 最新消息 ===== */
.news-section {
    padding: 100px 0;
    background: white;
}

.news-item {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
    border-left: 5px solid var(--primary-red);
    transition: all 0.4s ease;
}

.news-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-medium);
}

.news-item h4 {
    color: var(--dark);
    font-weight: 700;
    margin-bottom: 10px;
}

.news-item .date {
    color: var(--primary-red);
    font-weight: 600;
    font-size: 0.9rem;
}

.news-item .content {
    color: #555;
    line-height: 1.8;
    margin-top: 15px;
}

.news-pinned {
    border-left-color: var(--gold);
    position: relative;
}

.news-pinned::before {
    content: '📌 置頂';
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--gradient-3);
    color: var(--dark);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ===== 特色區塊 ===== */
.feature-card {
    text-align: center;
    padding: 40px 30px;
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 2rem;
    background: var(--gradient-1);
    color: white;
}

.feature-icon.teal { background: linear-gradient(135deg, #0D9488, #14B8A6); }
.feature-icon.purple { background: linear-gradient(135deg, #7C3AED, #A78BFA); }
.feature-icon.gold { background: var(--gradient-3); color: var(--dark); }

.feature-card h4 {
    font-weight: 700;
    margin-bottom: 15px;
}

.feature-card p {
    color: #666;
    line-height: 1.7;
}

/* ===== 關於頁面 ===== */
.about-section {
    padding: 100px 0;
}

.about-card {
    background: white;
    border-radius: 24px;
    padding: 50px;
    box-shadow: var(--shadow-soft);
    height: 100%;
}

.about-icon {
    font-size: 5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 聯絡頁面 ===== */
.map-container {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

/* ===== 按鈕 ===== */
.btn-primary {
    background: var(--gradient-1);
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.4s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
    background: var(--primary-red);
}

.btn-outline-primary {
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.4s ease;
}

.btn-outline-primary:hover {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
}

/* ===== 後台樣式 ===== */
.admin-sidebar {
    background: var(--gradient-2);
    min-height: 100vh;
    color: white;
    padding-top: 30px;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 15px 25px;
    border-radius: 12px;
    margin: 5px 15px;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: var(--gradient-1);
    color: white;
}

.admin-content {
    background: #f8f9fa;
    min-height: 100vh;
}

/* ===== 表單美化 ===== */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 18px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 4px rgba(212, 56, 13, 0.1);
}

.form-label {
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 8px;
}

/* ===== 動畫 ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 響應式 ===== */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.8rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 70vh;
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-hero-primary, .btn-hero-secondary {
        width: 100%;
        max-width: 280px;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .footer {
        padding: 50px 0 30px;
    }
    
    .about-card {
        padding: 30px;
    }
}

/* 滾動動畫觸發 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 延遲動畫 */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }