/* ============================
   CUSTOM CSS PUSTIPD
   Sudah diperbaiki dan dirapikan
   ============================ */

/* Home Page - Card Animation (tetap sama) */
.card-animated {
    position: relative;
    z-index: 0;
    min-height: 200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 0.5rem;
}

.card-animated::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    transform: translateY(100%);
    transition: transform 0.5s ease-in-out;
    z-index: -1;
    background-color: #f3ba00 !important;
    border-radius: 0.5rem;
}

.group {
    border-radius: 0.5rem !important;
    position: relative;
    isolation: isolate;
}
.group:hover .card-animated::before {
    transform: translateY(0%);
    background-color: #f3ba00;
}

.card-text {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    color: #062749;
}

/* Achievement Carousel - Container */
.achievement-carousel {
    width: 100%;
    max-width: 100vw;
    position: relative;
}

.achievement-carousel-track-desktop,
.achievement-carousel-track-mobile {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.achievement-carousel-track-desktop > *,
.achievement-carousel-track-mobile > * {
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Card Wrapper */
.achievement-card-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.achievement-card-wrapper .group {
    height: 100%;
    border-radius: 0.5rem !important;
    overflow: hidden !important;
    position: relative;
}

/* Mobile Styles (default) - 1 card */
@media (max-width: 1023px) {
    .achievement-card-wrapper {
        min-height: 200px;
        max-width: 320px;
        margin: 0 auto;
    }

    .achievement-carousel {
        padding: 0 1rem;
    }

    .card-animated {
        min-height: 180px;
        padding: 1.5rem;
    }

    /* Mobile track specific */
    .achievement-carousel-track-mobile {
        display: flex !important;
    }

    .achievement-carousel-track-desktop {
        display: none !important;
    }
}

/* Desktop Styles - 5 cards */
@media (min-width: 1024px) {
    .achievement-card-wrapper {
        min-height: 250px;
        flex-shrink: 0;
    }

    /* Desktop track specific */
    .achievement-carousel-track-desktop {
        display: flex !important;
    }

    .achievement-carousel-track-mobile {
        display: none !important;
    }

    /* Desktop grid - 5 columns */
    .achievement-carousel-track-desktop .grid {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
        width: 100%;
    }

    .achievement-carousel-track-desktop .achievement-card-wrapper {
        width: 100%;
        min-width: 200px;
        max-width: 250px;
    }
}

/* Fix untuk rounded corner pada semua ukuran */
.achievement-card-wrapper .group,
.achievement-card-wrapper .card-animated,
.achievement-card-wrapper .card-animated::before {
    border-radius: 0.5rem !important;
}

/* Prevent horizontal scroll */
.achievement-carousel-track-desktop,
.achievement-carousel-track-mobile {
    padding: 0;
    margin: 0;
}

/* Indicators styling */
.achievement-indicator-desktop,
.achievement-indicator-mobile {
    cursor: pointer;
    border: none;
    color: white;
}

.achievement-indicator-desktop:focus,
.achievement-indicator-mobile:focus {
    outline: none;
}

/* Progress bar container */
.achievement-progress-bar {
    transition: width 0.1s ease-linear;
    height: 100%;
    border-radius: inherit;
}

/* Ensure proper positioning */
.achievement-carousel .relative {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Fix untuk mobile center alignment */
@media (max-width: 1023px) {
    .achievement-carousel-track-mobile .flex {
        justify-content: center;
        align-items: center;
        padding: 1rem 0;
    }
}

/* Additional fixes untuk smooth transition */
.achievement-carousel-track-desktop *,
.achievement-carousel-track-mobile * {
    box-sizing: border-box;
}

/* Hover effects */
.achievement-card-wrapper:hover .group {
    transform: translateY(-8px);
    transition: transform 0.3s ease;
}

.achievement-card-wrapper .group {
    transition: transform 0.3s ease;
}

.group {
    height: 100%;
}

/* Underline Animate (Global, satu deklarasi saja) */
.underline-animate::after {
    content: "";
    position: absolute;
    bottom: -1rem;
    left: 0;
    height: 4px;
    width: 0;
    background-color: #062749; /* Tailwind blue-500 */
    transition: width 0.4s ease;
}

.group:hover .underline-animate::after {
    width: 100%;
}

/* Gallery */
.gallery-card {
    position: relative;
    width: 100px;
    height: 100px;
    cursor: pointer;
}

.gallery-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px 0 rgb(0 0 0 / 5%);
    background: #f3f4f6;
    display: block;
}

.caption-hover {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    background: rgba(6, 39, 73, 0.6);
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 0.93rem;
    font-weight: 600;
    border-radius: 0.75rem;
    text-align: center;
    transition: opacity 0.25s;
    pointer-events: none;
    padding: 0 8px;
}

.gallery-card:hover .caption-hover {
    opacity: 1;
    pointer-events: auto;
}

.gallery-popup-bg {
    position: fixed;
    inset: 0;
}

.gallery-popup-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1050; /* Ensure it is above other elements */
}

.gallery-popup-box {
    background: #fff;
    border-radius: 0.75rem;
    max-width: 92vw;
    max-height: 88vh;
    box-shadow: 0 6px 32px 0 rgb(0 0 0 / 20%);
    padding: 18px 18px 24px 18px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-popup-img {
    max-width: 80vw;
    max-height: 60vh;
    border-radius: 0.5rem;
    margin-top: 8px;
}

.popup-caption {
    color: #314061;
    font-size: 1.05rem;
    margin-bottom: 8px;
    font-weight: 600;
    text-align: center;
}

.popup-close {
    position: static;
    margin-top: 16px;
    background: #062749;
    color: #fff;
    border-radius: 10px;
    border: none;
    padding: 0.4rem 1.2rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
}

/* Content About (dulu nested di popup-close) */
.content-about {
    max-width: 600px;
}

/* Announcements */
.announcement-grid > * {
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

/* News */
.news-grid > * {
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.news-article-content {
    color: #272a33;
    font-size: 1.09rem;
    line-height: 1.7;
}

.news-date-cat {
    color: #4671af;
    font-weight: 500;
    font-size: 0.97rem;
    margin-bottom: 1rem;
}

.news-title-detail {
    color: #062749;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.15rem;
    text-align: center;
}

.news-img-detail {
    width: 100%;
    max-width: 820px;
    max-height: 420px;
    display: block;
    object-fit: cover;
    border-radius: 1rem;
    margin: 1.5rem auto 2.5rem auto;
    box-shadow: 0 4px 20px rgba(6, 39, 73, 0.12);
    background: #f5f6fa;
    border: 2px solid #e3f2fd;
}

.choice-btn {
    background: #f0f9ff;
    color: #062749;
    border-radius: 0.5rem;
    padding: 0.5rem 1.2rem;
    border: 1px solid #bfdbfe;
    outline: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.96rem;
    display: flex;
    align-items: center;
    gap: 0.4em;
    transition: all 0.2s ease;
}

.choice-btn:hover {
    background: #062749;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 39, 73, 0.2);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 900px) {
    .news-img-detail {
        max-width: 99vw;
    }
}

@media (max-width: 640px) {
    .news-title-detail {
        font-size: 1.4rem;
    }

    .news-img-detail {
        max-width: 99vw;
        height: auto;
    }

    .news-article-content {
        font-size: 1rem;
    }

    .share-choices {
        padding: 8px 12px;
        flex-wrap: wrap;
    }
}

.news-full-article-container {
    background: #fff;
    border-radius: 1rem;
    padding: 2.7rem 2.1rem 2.2rem;
    margin: auto;
    max-width: 900px;
    position: relative;
    overflow: hidden;
}

.news-full-article-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.announcement-full-article-container {
    background: #fff;
    border-radius: 1rem;
    padding: 2.7rem 2.1rem 2.2rem;
    box-shadow: 0 4px 25px rgba(220, 38, 38, 0.08);
    margin: auto;
    max-width: 900px;
    position: relative;
    overflow: hidden;
}

.announcement-full-article-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    padding: 0.5rem 1rem;
    background: #fef2f2;
    border-radius: 0.5rem;
    color: #dc2626;
    font-weight: 600;
    font-size: 0.875rem;
}

.urgent-badge {
    animation: pulse 2s infinite;
}

.expiry-notice {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem auto;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(254, 215, 170, 0.3);
    color: #ea580c;
    position: relative;
}

.announcement-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: #fef2f2;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    margin-bottom: 1rem;
}

.announcement-title-detail {
    color: #062749;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.7rem;
    text-align: center;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

@media (max-width: 900px) {
    .announcement-img-detail {
        max-width: 99vw;
    }
}

@media (max-width: 640px) {
    .announcement-title-detail {
        font-size: 1.4rem;
    }

    .announcement-img-detail {
        max-width: 99vw;
        height: auto;
    }

    .announcement-article-content {
        font-size: 1rem;
    }

    .share-choices {
        padding: 8px 12px;
        flex-wrap: wrap;
    }

    .announcement-full-article-container {
        padding: 1.5rem 1.2rem;
    }
}

/* Struktur */
.struktur-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 100px;
    margin: 0 auto 3rem;
}

.struktur-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgb(6 39 73 / 0.1);
    padding: 1.5rem 1rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    cursor: default;
}

.struktur-card:hover {
    box-shadow: 0 8px 24px rgb(6 39 73 / 0.15);
    transform: translateY(-6px);
}

.struktur-card img {
    width: 180px;
    height: 220px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 1rem;
}

.struktur-nama {
    font-size: 1.1rem;
    font-weight: 700;
    color: #062749;
    margin-bottom: 0.4rem;
    text-align: center;
}

.struktur-jabatan {
    font-size: 0.9rem;
    color: #506176;
    text-align: center;
}

.divisi-title {
    text-align: center;
    font-weight: 700;
    font-size: 1.8rem;
    color: #062749;
    margin: 3rem auto 1rem;
    padding-bottom: 0.3rem;
    position: relative;
}

/* Tutorial */
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.tutorial-card {
    background: white;
    border-radius: 0.6rem;
    box-shadow: 0 4px 16px rgba(6, 39, 73, 0.08);
    padding: 1.2rem 1.05rem 1.4rem 1.05rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.23s, transform 0.23s;
    cursor: pointer;
}

.tutorial-card:hover {
    box-shadow: 0 8px 32px rgba(6, 39, 73, 0.14);
    transform: translateY(-4px) scale(1.035);
}

.tutorial-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #062749;
    margin-bottom: 0.45rem;
}

.tutorial-excerpt {
    color: #506176;
    font-size: 0.97rem;
    line-height: 1.5;
    min-height: 38px;
}

/* Card Visi Misi */
.card-visi-misi {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
    padding: 3rem;
    margin-bottom: 2rem;
    border: 1px solid #e0e6f0;
    transition: box-shadow 0.2s;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.card-visi-misi:hover {
    box-shadow: 0 4px 24px 0 rgba(6, 39, 73, 0.08);
}

.card-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: #062749;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 0.01em;
}

.card-body {
    color: #313451;
    font-size: 1.05rem;
    text-align: center;
    line-height: 1.6;
}

.card-body ol {
    text-align: left;
    margin-left: 1rem;
}
/* Table Styles */
.ketetapan-table {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(6, 39, 73, 0.08);
    border: 1px solid rgba(6, 39, 73, 0.1);
}

.table-header {
    background: linear-gradient(135deg, #062749 0%, #0f3460 100%);
    color: white;
}

.table-row:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.download-btn {
    background: linear-gradient(135deg, #062749 0%, #0f3460 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.download-btn:hover {
    background: linear-gradient(135deg, #0f3460 0%, #1a4a73 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 39, 73, 0.3);
}

.not-available {
    color: #9ca3af;
    font-style: italic;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 640px) {
    .struktur-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .struktur-card img {
        width: 160px;
        height: 200px;
    }

    .tutorial-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1.3rem;
    }

    .tutorial-card img {
        width: 56px;
        height: 56px;
    }

    .announcement-article-content {
        color: #062749;
        font-size: 1.09rem;
        line-height: 1.7;
    }

    .announcement-date-cat {
        color: #dc2626;
        font-weight: 500;
        font-size: 0.97rem;
        margin-bottom: 1rem;
    }

    .announcement-title-detail {
        color: #062749;
        font-size: 2rem;
        font-weight: 700;
        line-height: 1.15;
        margin-bottom: 0.7rem;
        text-align: center;
    }

    .share-btn-wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        margin: 1.8rem 0 2.4rem 0;
    }

    .main-share-btn {
        background: #dc2626;
        color: #fff;
        font-weight: 600;
        border: none;
        outline: none;
        border-radius: 0.5rem;
        padding: 0.68rem 1.8rem;
        font-size: 1.09rem;
        cursor: pointer;
        box-shadow: 0 4px 14px rgba(220, 38, 38, 0.2);
        display: flex;
        align-items: center;
        gap: 0.7em;
        transition: all 0.3s ease;
        transform: translateY(0);
    }

    .main-share-btn:hover {
        background: #dc4444;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
    }

    .share-choices {
        display: none;
        flex-direction: row;
        gap: 0.65rem;
        margin-top: 0.8rem;
        background: #fff;
        border-radius: 1rem;
        box-shadow: 0 10px 35px rgba(220, 38, 38, 0.1);
        padding: 12px 24px;
        z-index: 20;
        animation: fadeInUp 0.18s ease;
        border: 1px solid #fecaca;
    }

    .share-choices.active {
        display: flex;
    }

    .choice-btn {
        background: #fef2f2;
        color: #dc2626;
        border-radius: 0.5rem;
        padding: 0.5rem 1.2rem;
        border: 1px solid #fecaca;
        outline: none;
        cursor: pointer;
        font-weight: 600;
        font-size: 0.96rem;
        display: flex;
        align-items: center;
        gap: 0.4em;
        transition: all 0.2s ease;
    }

    .choice-btn:hover {
        background: #dc2626;
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
    }
}
