/* Responsive Officials Cards CSS */
/* Memperbaiki tampilan kartu pejabat untuk mobile dan desktop */

/* ===== BASE OFFICIALS SECTION ===== */
.ppid-officials {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.ppid-officials::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23ffffff" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 1;
}

.ppid-officials .container {
    position: relative;
    z-index: 2;
}

/* ===== OFFICIALS CAROUSEL CONTAINER ===== */
.officials-carousel-container {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    max-width: 100%;
}

.officials-carousel {
    position: relative;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
}

/* ===== DESKTOP LAYOUT (992px+) ===== */
@media (min-width: 992px) {
    .carousel-slide {
        flex: 0 0 33.333333%; /* 3 cards per row */
        padding: 0 15px;
        box-sizing: border-box;
    }
    
    .officials-carousel-container {
        max-width: 1200px;
    }
}

/* ===== TABLET LAYOUT (768px - 991px) ===== */
@media (max-width: 991.98px) and (min-width: 768px) {
    .carousel-slide {
        flex: 0 0 50%; /* 2 cards per row */
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    .officials-carousel-container {
        max-width: 800px;
    }
}

/* ===== MOBILE LAYOUT (< 768px) ===== */
@media (max-width: 767.98px) {
    .ppid-officials {
        padding: 3rem 0;
    }
    
    /* Mobile: Show cards in responsive grid */
    .officials-carousel-container {
        overflow: visible; /* Allow cards to wrap */
        max-width: 100%;
    }
    
    .officials-carousel {
        width: 100%;
    }
    
    .carousel-track {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        transform: none !important; /* Disable carousel transform */
        transition: none !important;
        width: 100% !important;
    }
    
    .carousel-slide {
        flex: none !important;
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Hide carousel navigation on mobile */
    .carousel-nav,
    .carousel-dots {
        display: none !important;
    }
}

/* ===== SMALL MOBILE (< 576px) ===== */
@media (max-width: 575.98px) {
    .carousel-track {
        grid-template-columns: 1fr !important; /* Single column on very small screens */
        gap: 1rem;
    }
    
    .ppid-officials {
        padding: 2rem 0;
    }
    
    .ppid-officials .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ===== OFFICIAL CARD STYLES ===== */
.official-card-homepage {
    background: white;
    border-radius: 15px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.official-card-homepage:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 2px solid #0d6efd;
}

.official-card-homepage .card-body {
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* ===== PHOTO CONTAINER ===== */
.official-photo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.official-card-homepage:hover .official-photo-container {
    border-color: #0d6efd;
    transform: scale(1.05);
}

.official-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.official-card-homepage:hover .official-photo-container img {
    transform: scale(1.1);
}

/* Default avatar styling */
.official-photo-container .default-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    font-size: 2.5rem;
}

/* ===== ROLE BADGE ===== */
.role-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.role-badge.penanggung-jawab {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.role-badge.ketua {
    background: linear-gradient(135deg, #0d6efd, #0056b3);
    color: white;
}

.role-badge.wakil {
    background: linear-gradient(135deg, #198754, #157347);
    color: white;
}

.role-badge.koordinator {
    background: linear-gradient(135deg, #fd7e14, #e55a00);
    color: white;
}

.role-badge.default {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

/* ===== TEXT CONTENT ===== */
.official-card-homepage .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.official-card-homepage:hover .card-title {
    color: #0d6efd;
}

.official-card-homepage .card-text {
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* ===== LOGOS SECTION ===== */
.official-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.official-logos img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.official-card-homepage:hover .official-logos img {
    opacity: 1;
    transform: scale(1.1);
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 767.98px) {
    .official-card-homepage .card-body {
        padding: 1.5rem 1rem;
    }
    
    .official-photo-container {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }
    
    .official-card-homepage .card-title {
        font-size: 1.1rem;
    }
    
    .official-card-homepage .card-text {
        font-size: 0.9rem;
    }
    
    .role-badge {
        top: 10px;
        left: 10px;
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .official-logos img {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 575.98px) {
    .official-card-homepage .card-body {
        padding: 1.25rem 0.75rem;
    }
    
    .official-photo-container {
        width: 90px;
        height: 90px;
    }
    
    .official-card-homepage .card-title {
        font-size: 1rem;
    }
    
    .official-card-homepage .card-text {
        font-size: 0.85rem;
    }
}

/* ===== CAROUSEL NAVIGATION ===== */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #0d6efd;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.carousel-nav:hover {
    background: #0d6efd;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: -25px;
}

.carousel-nav.next {
    right: -25px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: #0d6efd;
    transform: scale(1.2);
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #0d6efd, #0056b3);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 3rem;
}

@media (max-width: 767.98px) {
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .official-card-homepage,
    .official-photo-container,
    .carousel-nav,
    .carousel-dot {
        transition: none;
    }
    
    .carousel-track {
        transition: none;
    }
}

/* ===== LOADING STATE ===== */
.official-card-homepage.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
