/**
 * JCI Sanxia - Contact Page
 * jci-contact.css
 * 
 * 需搭配 jci-christmas.css 使用（CSS 變數來源）
 */

/* ===== Hero 區塊 ===== */
.contact-hero {
    position: relative;
    background: linear-gradient(135deg, var(--jci-blue-dark) 0%, var(--jci-blue) 100%);
    padding: 80px 0 120px;
    margin-top: -80px;
    overflow: hidden;
}

    .contact-hero::before {
        content: '';
        position: absolute;
        inset: 0;
        background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    }

.contact-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-top: 60px;
}

.contact-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 8px 20px;
    border-radius: 50px;
    margin-bottom: 20px;
}

    .contact-hero-badge span {
        color: var(--jci-gold-light);
        font-size: 0.85rem;
        font-weight: 500;
        letter-spacing: 1px;
    }

.contact-hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
}

.contact-hero p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== 地圖區塊 ===== */
.map-section {
    margin-top: -60px;
    position: relative;
    z-index: 10;
    padding: 0 15px;
}

.map-wrapper {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    max-width: 1200px;
    margin: 0 auto;
}

    .map-wrapper iframe {
        width: 100%;
        height: 350px;
        display: block;
        border: none;
    }

/* ===== 聯絡內容區塊 ===== */
.contact-content-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--warm-cream) 0%, white 100%);
}

/* ===== 表單卡片 ===== */
.contact-form-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

    .contact-form-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 5px;
        background: linear-gradient(90deg, var(--jci-gold), var(--christmas-red), var(--jci-blue));
    }

    .contact-form-card h3 {
        font-family: 'Playfair Display', Georgia, serif;
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--jci-blue-dark);
        margin-bottom: 25px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .contact-form-card h3::before {
            content: '✉️';
            font-size: 1.3rem;
        }

/* 聖誕裝飾 */
.christmas-decoration {
    position: absolute;
    font-size: 2rem;
    opacity: 0.15;
    pointer-events: none;
}

    .christmas-decoration.top-left {
        top: 20px;
        left: 20px;
    }

    .christmas-decoration.bottom-right {
        bottom: 20px;
        right: 20px;
    }

/* ===== 表單元素 ===== */
.contact-form .form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.contact-form .form-control {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

    .contact-form .form-control:focus {
        border-color: var(--jci-blue);
        box-shadow: 0 0 0 4px rgba(26, 95, 122, 0.1);
        outline: none;
    }

    .contact-form .form-control::placeholder {
        color: #a0aec0;
    }

.btn-submit {
    background: linear-gradient(135deg, var(--jci-blue), var(--jci-blue-dark));
    color: white;
    font-weight: 700;
    padding: 14px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

    .btn-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(26, 95, 122, 0.3);
        color: white;
    }

/* ===== 表單 Overlay ===== */
.form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 20px;
}

    .form-overlay.active {
        display: flex;
    }

.form-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(26, 95, 122, 0.1);
    border-top-color: var(--jci-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Alert 樣式 ===== */
.contact-form .alert {
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: none;
}

.contact-form .alert-success {
    background: rgba(22, 91, 51, 0.1);
    color: var(--christmas-green);
}

.contact-form .alert-danger {
    background: rgba(196, 30, 58, 0.1);
    color: var(--christmas-red);
}

/* ===== 聯絡資訊區塊 ===== */
.contact-info-wrapper {
    padding-left: 30px;
}

.contact-info-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--jci-blue-dark);
    margin-bottom: 15px;
}

.contact-info-header p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 35px;
}

/* ===== 聯絡項目 ===== */
.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}

    .contact-item:last-child {
        border-bottom: none;
    }

    .contact-item:hover {
        transform: translateX(5px);
    }

.contact-item-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--jci-blue), var(--jci-blue-dark));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 5px 20px rgba(26, 95, 122, 0.25);
}

    .contact-item-icon svg {
        width: 26px;
        height: 26px;
        fill: white;
    }

.contact-item-content h5 {
    font-weight: 700;
    color: var(--jci-blue-dark);
    margin-bottom: 5px;
    font-size: 1rem;
}

.contact-item-content a,
.contact-item-content p {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    margin: 0;
    transition: color 0.3s ease;
}

    .contact-item-content a:hover {
        color: var(--jci-blue);
    }

/* ===== 社群連結 ===== */
.social-links {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

    .social-links h5 {
        font-weight: 700;
        color: var(--jci-blue-dark);
        margin-bottom: 15px;
        font-size: 0.95rem;
    }

.social-icons {
    display: flex;
    gap: 12px;
}

.social-icon {
    width: 45px;
    height: 45px;
    background: rgba(26, 95, 122, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

    .social-icon:hover {
        background: var(--jci-blue);
        transform: translateY(-3px);
    }

    .social-icon svg {
        width: 22px;
        height: 22px;
        fill: var(--jci-blue);
        transition: fill 0.3s ease;
    }

    .social-icon:hover svg {
        fill: white;
    }

/* ===== 響應式設計 ===== */
@media (max-width: 992px) {
    .contact-info-wrapper {
        padding-left: 0;
        margin-top: 50px;
    }

    .contact-form-card {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    /* Contact Hero - JS 會動態調整 padding-top */
    .contact-hero {
        padding: 80px 0 100px; /* 預設值，JS 會覆蓋 padding-top */
        margin-top: 0;
    }

    .contact-hero-content {
        padding-top: 20px;
    }

    .contact-hero h1 {
        font-size: 1.8rem;
    }

    .contact-hero p {
        font-size: 1rem;
    }

    .map-wrapper iframe {
        height: 280px;
    }

    .contact-content-section {
        padding: 60px 0;
    }

    .contact-form-card {
        padding: 25px;
    }

        .contact-form-card h3 {
            font-size: 1.3rem;
        }

    .contact-item {
        padding: 15px 0;
    }

    .contact-item-icon {
        width: 48px;
        height: 48px;
    }

        .contact-item-icon svg {
            width: 22px;
            height: 22px;
        }

    .contact-info-header h2 {
        font-size: 1.6rem;
    }

    .contact-info-wrapper {
        padding-left: 0;
        margin-top: 40px;
    }
}

@media (max-width: 576px) {
    /* Contact Hero - JS 會動態調整 padding-top */
    .contact-hero {
        padding: 70px 0 80px;
    }

    .contact-hero-content {
        padding-top: 10px;
    }

    .contact-hero-badge {
        padding: 6px 16px;
    }

        .contact-hero-badge span {
            font-size: 0.75rem;
        }

    .contact-hero h1 {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .contact-hero p {
        font-size: 0.9rem;
        padding: 0 15px;
    }

    /* 地圖 */
    .map-section {
        margin-top: -50px;
    }

    .map-wrapper iframe {
        height: 240px;
    }

    /* 表單 */
    .contact-form-card {
        padding: 20px;
    }

        .contact-form-card h3 {
            font-size: 1.15rem;
        }

    .contact-form .form-control {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .btn-submit {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    /* 聯絡資訊 */
    .contact-content-section {
        padding: 50px 0;
    }

    .contact-info-header h2 {
        font-size: 1.4rem;
    }

    .contact-info-header p {
        font-size: 0.9rem;
    }

    .contact-item {
        gap: 15px;
    }

    .contact-item-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .contact-item-content h5 {
        font-size: 0.95rem;
    }

    .contact-item-content a,
    .contact-item-content p {
        font-size: 0.9rem;
    }

    .social-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 400px) {
    .contact-hero {
        padding: 60px 0 70px;
    }

        .contact-hero h1 {
            font-size: 1.35rem;
        }

    .contact-form-card {
        padding: 18px 15px;
    }

    .contact-item-icon {
        width: 40px;
        height: 40px;
    }
}

/* ===== 減少動畫（無障礙）===== */
@media (prefers-reduced-motion: reduce) {
    .contact-item:hover {
        transform: none;
    }

    .social-icon:hover {
        transform: none;
    }

    .btn-submit:hover {
        transform: none;
    }

    .form-spinner {
        animation: none;
    }
}

/* ===== 列印樣式 ===== */
@media print {
    .contact-hero,
    .map-section,
    .contact-form-card,
    .social-links {
        display: none !important;
    }

    .contact-content-section {
        padding: 20px 0;
    }
}
