/* ===== ANNOUNCEMENT ALERT STYLES ===== */
/*--------------------------------------------------------------
# Font & Color Variables
# Help: https://bootstrapmade.com/color-system/
--------------------------------------------------------------*/
/* Fonts */
:root {
}

/* Global Colors - The following color variables are used throughout the website. Updating them here will change the color scheme of the entire website */
:root { 
  --default-color: #444444; /* Default color used for the majority of the text content across the entire website */
  --heading-color: #37517e; /* Color for headings, subheadings and title throughout the website */
--accent-color: #ffaf26; /* Accent color that represents your brand on the website. It's used for buttons, links, and other elements that need to stand out */
  --surface-color: #ffffff; /* The surface color is used as a background of boxed elements within sections, such as cards, icon boxes, or other elements that require a visual separation from the global background. */
}

/* Color Presets - These classes override global colors when applied to any section or element, providing reuse of the sam color scheme. */
.light-background {
  --surface-color: #ffffff;
}

.dark-background {
  --default-color: #ffffff;
  --heading-color: #ffffff;
  --surface-color: #4668a2;
}

/* Main Alert Container */
.announcement-alert-wrapper {
    position: fixed;
    top: 150px;
    right: 20px;
    z-index: 9998;
    animation: announcementSlideInRight 0.4s ease-out;
    max-width: 380px;
    width: 100%;
}

.index-page.scrolled .announcement-alert-wrapper {
    top: 100px;
}

body:not(.index-page) .announcement-alert-wrapper {
    top: 100px;
}

@keyframes announcementSlideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.announcement-alert-container {
    background: var(--surface-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    border: 2px solid var(--accent-color);
    overflow: hidden;
    position: relative;
}

/* Slider */
.announcement-slider {
    position: relative;
}

.announcement-item {
    display: none;
    position: relative;
}

.announcement-item.active {
    display: block;
    animation: announcementFadeIn 0.4s ease-in-out;
}

@keyframes announcementFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Content */
.announcement-content {
    padding: 20px;
}

.announcement-header {
    margin-bottom: 15px;
}

.announcement-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(
        135deg,
        var(--accent-color),
        color-mix(in srgb, var(--accent-color), black 20%)
    );
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    width: fit-content;
}

.announcement-badge i {
    font-size: 0.9rem;
}

.announcement-message h5 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading-color);
    line-height: 1.3;
}

.announcement-description {
    font-size: 0.85rem;
    color: var(--default-color);
    line-height: 1.4;
}

/* Style untuk konten HTML dari TinyMCE */
.announcement-description p {
    margin: 0 0 8px 0;
}

.announcement-description p:last-child {
    margin-bottom: 0;
}

.announcement-description ul,
.announcement-description ol {
    margin: 8px 0;
    padding-left: 16px;
}

.announcement-description li {
    margin-bottom: 3px;
}

.announcement-description strong {
    font-weight: 600;
    color: var(--heading-color);
}

.announcement-description em {
    font-style: italic;
}

.announcement-description a {
    color: var(--accent-color);
    text-decoration: underline;
}

.announcement-description a:hover {
    opacity: 0.8;
}

/* Long Content Preview */
.announcement-description-preview {
    position: relative;
    max-height: 80px;
    overflow: hidden;
    margin-bottom: 8px !important;
}

.announcement-description-preview::after {
    content: "" !important;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, var(--surface-color)) !important;
    pointer-events: none;
}

.btn-read-more {
    background: transparent !important;
    border: 1px solid var(--accent-color) !important;
    color: var(--accent-color) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    padding: 4px 12px !important;
    border-radius: 4px !important;
    margin-top: 8px !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    z-index: 10 !important;
    position: relative !important;
}

.btn-read-more:hover {
    background: var(--accent-color) !important;
    color: white !important;
    transform: translateY(-1px) !important;
}

/* Footer & Navigation */
.announcement-footer {
    border-top: 1px solid
        color-mix(in srgb, var(--accent-color), transparent 80%);
    padding-top: 12px;
}

.announcement-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.announcement-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-color);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: 500;
    flex: 1;
    justify-content: center;
}

.announcement-nav-btn:hover {
    background: var(--accent-color);
    color: var(--contrast-color);
    transform: translateY(-1px);
}

.announcement-nav-btn:active {
    transform: translateY(0);
}

.announcement-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.announcement-nav-btn:disabled:hover {
    background: var(--surface-color);
    color: var(--accent-color);
}

/* Close Button */
.announcement-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.1);
    color: var(--default-color);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.announcement-close-btn:hover {
    background: var(--accent-color);
    color: var(--contrast-color);
    transform: rotate(90deg);
}

/* Close Animation */
@keyframes announcementSlideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.announcement-alert-wrapper.closing {
    animation: announcementSlideOutRight 0.4s ease-in forwards;
}

/* Enhanced Announcement Controls */
.announcement-controls {
    padding: 16px 20px;
    border-top: 1px solid
        color-mix(in srgb, var(--accent-color), transparent 85%);
    background: color-mix(in srgb, var(--surface-color), white 5%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.dont-show-again {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--default-color);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 0;
    flex: 1;
}

.dont-show-again:hover {
    color: var(--heading-color);
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid color-mix(in srgb, var(--accent-color), transparent 40%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    background: var(--surface-color);
    flex-shrink: 0;
}

.custom-checkbox::after {
    content: "";
    width: 10px;
    height: 6px;
    border: 2px solid white;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg);
    opacity: 0;
    transition: all 0.3s ease;
    position: absolute;
    top: 3px;
    left: 2px;
}

#dontShowAlertAgain:checked + .custom-checkbox {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

#dontShowAlertAgain:checked + .custom-checkbox::after {
    opacity: 1;
}

#dontShowAlertAgain:focus + .custom-checkbox {
    box-shadow: 0 0 0 3px
        color-mix(in srgb, var(--accent-color), transparent 70%);
}

.checkbox-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--default-color);
    transition: color 0.3s ease;
    line-height: 1.3;
}

.dont-show-again:hover .checkbox-label {
    color: var(--heading-color);
}

.dont-show-again:hover .custom-checkbox {
    border-color: color-mix(in srgb, var(--accent-color), transparent 20%);
}

#dontShowAlertAgain {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Modal Styles */
#alertContentModal.modal {
    z-index: 9999 !important;
}

#alertContentModal + .modal-backdrop {
    z-index: 9998 !important;
}

.alert-modal-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--default-color);
}

.alert-modal-content p {
    margin-bottom: 12px;
}

.alert-modal-content ul,
.alert-modal-content ol {
    margin: 12px 0;
    padding-left: 20px;
}

.alert-modal-content strong {
    font-weight: 600;
    color: var(--heading-color);
}


.announcement-fab {
    position: fixed;
    bottom: 55px; /* Default position di atas WhatsApp button */
    right: 15px;
    z-index: 9997;
    display: none;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Ketika scroll-top muncul (#scroll-top.shown), FAB announcement bergeser ke atas */
#scroll-top.shown ~ main .announcement-fab,
body.scrolled .announcement-fab {
    bottom: 80px; /* Bergeser naik saat scroll-top muncul (di atas scroll-top) */
}

.announcement-fab.show {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.announcement-fab.hiding {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
}

.fab-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffb74d 0%, #ff9800 100%);
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.fab-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.fab-btn:active::before {
    width: 100px;
    height: 100px;
}

.fab-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.fab-btn:active {
    transform: translateY(0) scale(0.98);
}

@keyframes fabPulse {
    0% {
        box-shadow: 0 4px 15px rgba(255, 183, 77, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 183, 77, 0.8),
            0 0 0 10px rgba(255, 183, 77, 0.1);
    }
    100% {
        box-shadow: 0 4px 15px rgba(255, 183, 77, 0.4);
    }
}

.fab-btn.pulse {
    animation: fabPulse 2s infinite;
}

@keyframes fabBounceIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-10px) scale(1.05);
    }
    70% {
        transform: translateY(5px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fab-btn.bounce-in {
    animation: fabBounceIn 0.6s ease-out;
}

@keyframes fabSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
}

.fab-btn.slide-out {
    animation: fabSlideOut 0.3s ease-in forwards;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .announcement-alert-wrapper {
        top: 70px;
        right: unset;
        left: 50%;
        max-width: 60dvh;
        transform: translateX(-50%);
    }

    .announcement-content {
        padding: 16px;
    }

    .announcement-badge {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .announcement-message h5 {
        font-size: 0.95rem;
    }

    .announcement-description {
        font-size: 0.8rem;
    }

    .announcement-nav-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    /* FAB Responsive */
    .announcement-fab {
        bottom: 60px;
        right: 15px;
    }

    #scroll-top.shown ~ main .announcement-fab,
    body.scrolled .announcement-fab {
        bottom: 95px;
    }

    .fab-btn {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .announcement-alert-wrapper {
        top: 60px;
        right: 8px;
        left: 8px;
    }

    .announcement-content {
        padding: 14px;
    }

    .announcement-navigation {
        flex-direction: column;
        gap: 6px;
    }

    .announcement-nav-btn {
        width: 100%;
    }

    .announcement-controls {
        padding: 14px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .dont-show-again {
        justify-content: center;
        text-align: center;
    }

    .checkbox-container {
        justify-content: center;
    }

    /* FAB Responsive */
    .announcement-fab {
        bottom: 58px;
        right: 12px;
    }

    #scroll-top.shown ~ main .announcement-fab,
    body.scrolled .announcement-fab {
        bottom: 92px;
    }

    .fab-btn {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .announcement-alert-container {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    .announcement-close-btn {
        background: rgba(255, 255, 255, 0.1);
    }
}
