/* ========================================
   Services Page Styles
   ======================================== */

/* Inline Style Extractions */
.service-hero-section {
    background-size: cover;
    background-position: center;
}

.section-header-centered {
    text-align: center;
    margin-bottom: 40px;
}

.section-title-large {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

.section-divider-gold {
    width: 60px;
    height: 3px;
    background: #d4a017;
    margin: 0 auto 20px;
}

.section-description-centered {
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* Fun Science Section */
.fun-science-section {
    padding: 60px 0;
    background-color: #f9f9f9;
    overflow: hidden;
}

.fun-science-carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.carousel-container {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%; /* Force 1 slide per view */
    flex-shrink: 0;
    box-sizing: border-box;
    /* Removed padding to let image fill full width if desired, or keep small padding */
    padding: 0; 
}

.science-card {
    background: #fff;
    overflow: hidden;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-image {
    width: 100%;
    height: 500px; /* Increased height for better visual impact as a single slider */
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.science-card:hover .card-image img {
    transform: scale(1.05);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 10;
    color: #333;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.carousel-btn:hover {
    background: #d4a017;
    color: #fff;
}

.prev-btn { left: 30px; }
.next-btn { right: 30px; }

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.dot.active {
    background: #d4a017;
    transform: scale(1.2);
    border-color: #fff;
}

@media (max-width: 768px) {
    .card-image {
        height: 300px; /* Smaller height on mobile */
    }
    .carousel-btn {
        display: none; /* Hide arrows on mobile */
    }
}

/* Case Studies Section */
.case-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.case-section-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.case-section-divider {
    width: 60px;
    height: 3px;
    background: #d4a017;
    margin: 0 auto 20px;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.case-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: none;
    cursor: pointer;
}

.case-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.case-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
}

.case-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.case-item:hover .case-image img {
    transform: scale(1.05);
}

.case-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    z-index: 2;
}

.case-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
    .case-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Modal Styles */
.case-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.case-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.case-modal-content {
    position: relative;
    width: 95%; /* Increased from 90% */
    max-width: 1600px; /* Increased from 1200px */
    height: 95vh; /* Increased from 90vh */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: zoomIn 0.3s ease;
    pointer-events: none; /* Let clicks pass through to overlay for closing empty areas */
}

.case-modal-content > * {
    pointer-events: auto; /* Re-enable clicks on children */
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.case-modal-image-container {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* overflow: hidden; Removed to allow zoom overflow if needed, though we handle scale via transform */
    margin-bottom: 15px;
    position: relative;
}

.case-modal-image {
    max-width: 100%;
    max-height: 90vh; /* Increased from 85vh */
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
    cursor: zoom-in;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center center;
    z-index: 20;
}

.case-modal-image.zoomed {
    transform: scale(2); /* Zoom level */
    cursor: zoom-out;
    max-height: none;
    max-width: none;
}

.case-modal-info {
    display: inline-block;
    padding: 8px 20px;
    color: #fff;
    text-align: center;
    background: rgba(255,255,255,0.1);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 21; /* Ensure above zoomed image if possible, or hide it */
    transition: opacity 0.3s;
}

.case-modal-content.is-zoomed .case-modal-info {
    opacity: 0; /* Hide info when zoomed to avoid obstruction */
    pointer-events: none;
}

.case-modal-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 1px;
    color: #fff;
}

.case-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    z-index: 10;
}

.case-modal-close:hover {
    transform: rotate(90deg);
    background: #d4a017;
}

@media (max-width: 768px) {
        .case-modal-close {
        top: 10px;
        right: 10px;
        background: rgba(0,0,0,0.5);
    }
    .case-modal-content {
        height: 100vh;
        width: 100%;
        background: #000;
        justify-content: center;
    }
        .case-modal-image {
        max-height: 80vh;
    }
}

/* 分页组件样式 */
.case-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 15px;
    flex-wrap: wrap;
}
.case-pagination .btn {
    min-width: 100px;
}
.case-pagination .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
    color: #999;
    border-color: #ddd;
}
.case-pagination-info {
    color: #666;
    font-size: 15px;
}
.case-pagination-error {
    width: 100%;
    text-align: center;
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}
.case-pagination-error a {
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
}
