/* ==========================================================================
   NK Cookie Consent Banner
   Powered by Touchnewmedia Co., Ltd.
   ========================================================================== */

.nk-cc-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 1120px;
    margin: 0 auto;
    z-index: 9998;

    background: #FFFFFF;
    border: 1px solid #F0F0F0;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(10, 22, 40, 0.12);
    padding: 24px 28px 28px;

    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;

    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #0A1628;

    /* Hidden by default — JS toggles .nk-cc-show */
    transform: translateY(140%);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.4s ease;
}

.nk-cc-banner.nk-cc-show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.nk-cc-banner.nk-cc-hide {
    transform: translateY(140%);
    opacity: 0;
    pointer-events: none;
}

/* Content (text) */
.nk-cc-content {
    flex: 1 1 420px;
    min-width: 0;
}

.nk-cc-text {
    margin: 0;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.65;
    color: #0A1628;
}

.nk-cc-link {
    color: #2563EB;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 400;
    transition: color 0.2s ease;
}

.nk-cc-link:hover,
.nk-cc-link:focus {
    color: #1D4ED8;
}

/* Actions */
.nk-cc-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Allow All button */
.nk-cc-allow {
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    padding: 11px 28px;
    border-radius: 980px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
    white-space: nowrap;
}

.nk-cc-allow:hover,
.nk-cc-allow:focus {
    background: #1D4ED8;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
    outline: none;
}

.nk-cc-allow:active {
    transform: translateY(0);
}

/* Settings icon button */
.nk-cc-settings {
    background: #F5F5F7;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6E6E73;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
}

.nk-cc-settings svg {
    width: 18px;
    height: 18px;
    transition: transform 0.5s ease;
}

.nk-cc-settings:hover,
.nk-cc-settings:focus {
    background: #EFF6FF;
    color: #2563EB;
    outline: none;
}

.nk-cc-settings:hover svg {
    transform: rotate(60deg);
}

/* Powered by signature */
.nk-cc-poweredby {
    position: absolute;
    bottom: 6px;
    right: 16px;
    font-size: 10px;
    font-weight: 300;
    color: #86868B;
    opacity: 0.7;
    letter-spacing: 0.02em;
    pointer-events: none;
}

/* Mobile */
@media (max-width: 768px) {
    .nk-cc-banner {
        bottom: 12px;
        left: 12px;
        right: 12px;
        padding: 18px 20px 22px;
        border-radius: 16px;
        gap: 14px;
        flex-direction: column;
        align-items: stretch;
    }

    .nk-cc-content {
        flex: 1 1 auto;
    }

    .nk-cc-text {
        font-size: 13px;
        line-height: 1.6;
    }

    .nk-cc-actions {
        width: 100%;
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }

    .nk-cc-allow {
        flex: 1;
        padding: 12px 20px;
        font-size: 14px;
    }

    .nk-cc-settings {
        width: 44px;
        height: 44px;
    }

    .nk-cc-poweredby {
        position: static;
        display: block;
        text-align: center;
        margin-top: 4px;
        font-size: 9px;
    }
}

/* ==========================================================================
   Preferences Modal
   ========================================================================== */
.nk-cc-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.nk-cc-modal.nk-cc-modal-show {
    display: block;
}

.nk-cc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 22, 40, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nk-cc-modal.nk-cc-modal-show .nk-cc-modal-backdrop {
    opacity: 1;
}

.nk-cc-modal-panel {
    position: relative;
    max-width: 560px;
    width: calc(100% - 32px);
    max-height: 88vh;
    margin: 5vh auto 0;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(10, 22, 40, 0.32);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition:
        transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.3s ease;
}

.nk-cc-modal.nk-cc-modal-show .nk-cc-modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.nk-cc-modal-head {
    padding: 22px 28px 18px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.nk-cc-modal-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0A1628;
    letter-spacing: -0.01em;
}

.nk-cc-modal-close {
    background: #F5F5F7;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    color: #6E6E73;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nk-cc-modal-close:hover,
.nk-cc-modal-close:focus {
    background: #EFF6FF;
    color: #2563EB;
    outline: none;
}

.nk-cc-modal-body {
    padding: 22px 28px;
    overflow-y: auto;
    flex: 1;
}

.nk-cc-modal-intro {
    margin: 0 0 20px;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.65;
    color: #6E6E73;
}

.nk-cc-cats {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nk-cc-cat {
    background: #F5F5F7;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    transition: background-color 0.2s ease;
}

.nk-cc-cat:hover {
    background: #EFF6FF;
}

.nk-cc-cat-text {
    flex: 1;
    min-width: 0;
}

.nk-cc-cat-name {
    font-size: 14px;
    font-weight: 600;
    color: #0A1628;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nk-cc-cat-req {
    font-size: 10px;
    font-weight: 500;
    background: #DBEAFE;
    color: #1D4ED8;
    padding: 2px 8px;
    border-radius: 980px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nk-cc-cat-desc {
    font-size: 12px;
    font-weight: 300;
    line-height: 1.55;
    color: #6E6E73;
}

/* Toggle switch */
.nk-cc-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.nk-cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.nk-cc-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #D1D5DB;
    border-radius: 24px;
    transition: background-color 0.25s ease;
}

.nk-cc-toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nk-cc-toggle input:checked + .nk-cc-toggle-slider {
    background: #2563EB;
}

.nk-cc-toggle input:checked + .nk-cc-toggle-slider::before {
    transform: translateX(18px);
}

.nk-cc-toggle input:disabled + .nk-cc-toggle-slider {
    opacity: 0.7;
    cursor: not-allowed;
}

.nk-cc-modal-foot {
    padding: 18px 28px 22px;
    border-top: 1px solid #F0F0F0;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.nk-cc-modal-save,
.nk-cc-modal-allow {
    flex: 1;
    border: none;
    padding: 12px 20px;
    border-radius: 980px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nk-cc-modal-save {
    background: #F5F5F7;
    color: #0A1628;
}

.nk-cc-modal-save:hover,
.nk-cc-modal-save:focus {
    background: #EFF6FF;
    color: #2563EB;
    outline: none;
}

.nk-cc-modal-allow {
    background: #2563EB;
    color: #fff;
}

.nk-cc-modal-allow:hover,
.nk-cc-modal-allow:focus {
    background: #1D4ED8;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
    outline: none;
}

@media (max-width: 768px) {
    .nk-cc-modal-panel {
        margin: 4vh auto 0;
        max-height: 92vh;
        border-radius: 16px;
    }
    .nk-cc-modal-head { padding: 18px 20px 14px; }
    .nk-cc-modal-body { padding: 18px 20px; }
    .nk-cc-modal-foot { padding: 14px 20px 18px; flex-direction: column; }
    .nk-cc-cat { padding: 14px 16px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .nk-cc-banner,
    .nk-cc-allow,
    .nk-cc-settings,
    .nk-cc-settings svg {
        transition: opacity 0.2s ease !important;
        transform: none !important;
    }

    .nk-cc-banner {
        transform: translateY(0) !important;
    }

    .nk-cc-banner:not(.nk-cc-show) {
        opacity: 0;
        pointer-events: none;
    }
}
