/* ============================================
   Demo Popup & Modal - Styles
   IMIN Go-Print Developer Portal
   ============================================ */

/* ============================================
   PAGE HEADER
============================================ */
.page-header-section {
    padding: 80px 60px 40px;
    background: var(--bg-primary);
}

.page-title {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.page-desc {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.8;
    max-width: 640px;
}

/* ============================================
   DEMO SECTIONS
============================================ */
.demo-section {
    padding: 60px;
    border-top: 1px solid var(--border-subtle);
}

.demo-section-alt {
    background: var(--surface-variant);
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(184, 255, 27, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.section-label .material-symbols-outlined {
    font-size: 16px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.section-desc {
    font-size: 16px;
    opacity: 0.7;
    margin-bottom: 40px;
    max-width: 600px;
}

/* ============================================
   DEMO CARD GRID
============================================ */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.demo-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-section-alt .demo-card {
    background: var(--bg-primary);
}

.demo-section .demo-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(184, 255, 27, 0.1);
}

.demo-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.demo-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.demo-card p {
    font-size: 14px;
    opacity: 0.7;
    line-height: 1.5;
    flex: 1;
}

/* ============================================
   BADGES
============================================ */
.demo-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-info    { background: rgba(99, 179, 237, 0.2); color: #63b3ed; border: 1px solid rgba(99, 179, 237, 0.4); }
.badge-success { background: rgba(72, 199, 142, 0.2); color: #48c78e; border: 1px solid rgba(72, 199, 142, 0.4); }
.badge-warning { background: rgba(255, 189, 46, 0.2);  color: #ffbd2e; border: 1px solid rgba(255, 189, 46, 0.4); }
.badge-danger  { background: rgba(255, 91, 91, 0.2);   color: #ff5b5b; border: 1px solid rgba(255, 91, 91, 0.4); }
.badge-accent  { background: rgba(184, 255, 27, 0.2);  color: #B8FF1B; border: 1px solid rgba(184, 255, 27, 0.4); }

/* ============================================
   BUTTONS
============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    width: 100%;
    justify-content: center;
}

.btn .material-symbols-outlined { font-size: 18px; }

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
}
.btn-primary:hover { background: var(--accent-secondary); transform: scale(1.02); }

.btn-accent {
    background: rgba(184, 255, 27, 0.15);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}
.btn-accent:hover { background: var(--accent-primary); color: var(--bg-primary); transform: scale(1.02); }

.btn-success {
    background: rgba(72, 199, 142, 0.15);
    color: #48c78e;
    border: 1px solid rgba(72, 199, 142, 0.5);
}
.btn-success:hover { background: #48c78e; color: #0b0b0c; transform: scale(1.02); }

.btn-warning {
    background: rgba(255, 189, 46, 0.15);
    color: #ffbd2e;
    border: 1px solid rgba(255, 189, 46, 0.5);
}
.btn-warning:hover { background: #ffbd2e; color: #0b0b0c; transform: scale(1.02); }

.btn-danger {
    background: rgba(255, 91, 91, 0.15);
    color: #ff5b5b;
    border: 1px solid rgba(255, 91, 91, 0.5);
}
.btn-danger:hover { background: #ff5b5b; color: #fff; transform: scale(1.02); }

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}
.btn-outline:hover { background: rgba(255,255,255,0.05); border-color: var(--text-primary); }

/* ============================================
   MODAL BACKDROP
============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   POPUP BASE
============================================ */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.95);
    z-index: 2100;
    background: var(--surface-variant);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* ============================================
   POPUP HEADER
============================================ */
.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0;
}

.popup-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-icon .material-symbols-outlined { font-size: 26px; }

.popup-icon-info    { background: rgba(99, 179, 237, 0.15); color: #63b3ed; }
.popup-icon-warning { background: rgba(255, 189, 46, 0.15); color: #ffbd2e; }
.popup-icon-accent  { background: rgba(184, 255, 27, 0.15); color: #B8FF1B; }
.popup-icon-success { background: rgba(72, 199, 142, 0.15); color: #48c78e; }
.popup-icon-danger  { background: rgba(255, 91, 91, 0.15);  color: #ff5b5b; }

.popup-close {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.7;
}
.popup-close:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.popup-close .material-symbols-outlined { font-size: 18px; }

/* ============================================
   POPUP BODY
============================================ */
.popup-body {
    padding: 20px 24px;
}

.popup-body h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.popup-body p {
    font-size: 15px;
    opacity: 0.8;
    line-height: 1.6;
}

.popup-list {
    list-style: none;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    opacity: 0.9;
}

.popup-list li .material-symbols-outlined {
    font-size: 18px;
    color: var(--accent-primary);
}

.popup-detail-box {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(184, 255, 27, 0.08);
    border: 1px solid rgba(184, 255, 27, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: var(--font-mono);
    color: var(--accent-primary);
}

.popup-detail-box .material-symbols-outlined { font-size: 18px; }

/* ============================================
   POPUP FOOTER
============================================ */
.popup-footer {
    padding: 16px 24px 24px;
}

.popup-footer-row {
    display: flex;
    gap: 12px;
}

.popup-footer-row .btn {
    flex: 1;
}

/* ============================================
   FULLSCREEN POPUP
============================================ */
.popup-fullscreen {
    inset: 0;
    top: 0 !important;
    left: 0 !important;
    transform: scale(0.96) !important;
    transform-origin: center center;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
}

.popup-fullscreen.active {
    transform: scale(1) !important;
}

.popup-fullscreen .popup-body {
    flex: 1;
    overflow-y: auto;
}

.popup-code-block {
    margin: 16px 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}

.code-label {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(184, 255, 27, 0.05);
    border-bottom: 1px solid var(--border-subtle);
    letter-spacing: 0.5px;
}

.popup-code-block pre {
    padding: 16px;
    margin: 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

.popup-info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.popup-info-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    font-size: 13px;
}

.popup-info-card .material-symbols-outlined {
    font-size: 28px;
    color: var(--accent-primary);
}

.popup-info-card strong {
    font-size: 14px;
}

.popup-info-card span {
    opacity: 0.6;
    font-size: 12px;
}

/* ============================================
   MEDIA POPUP
============================================ */
.popup-media {
    max-width: 680px;
    max-height: 90vh;
    display: flex !important;
    flex-direction: row;
    padding: 0;
    overflow: hidden;
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -48%) scale(0.95) !important;
}

.popup-media.active {
    transform: translate(-50%, -50%) scale(1) !important;
}

.popup-media .popup-body,
.popup-media .popup-footer {
    padding-left: 0;
    padding-right: 0;
}

.popup-close-absolute {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
}

.popup-media-preview {
    width: 260px;
    min-width: 260px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.media-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.media-placeholder > .material-symbols-outlined {
    font-size: 32px;
    color: var(--accent-primary);
}

.media-placeholder > span {
    font-size: 12px;
    opacity: 0.5;
    margin-bottom: 8px;
}

/* Mock receipt */
.media-mock-receipt {
    background: #f5f5f0;
    color: #1a1a1a;
    border-radius: 8px;
    padding: 14px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.7;
    width: 100%;
    text-align: left;
}

.receipt-line { display: block; }
.receipt-title { font-size: 13px; font-weight: 700; text-align: center; }
.receipt-sub   { font-size: 11px; text-align: center; opacity: 0.7; }
.receipt-divider { display: block; opacity: 0.4; letter-spacing: -0.5px; margin: 4px 0; }
.receipt-bold  { font-weight: 700; }
.receipt-center { text-align: center; }
.receipt-small { font-size: 10px; opacity: 0.5; }

.popup-media-info {
    flex: 1;
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    min-width: 0;
}

.popup-media-info .popup-footer {
    padding: 0;
    margin-top: auto;
}

.popup-media-info h3 {
    font-size: 18px;
    font-weight: 700;
}

.popup-media-info p {
    font-size: 14px;
    opacity: 0.75;
    line-height: 1.5;
    flex: 1;
}

/* ============================================
   NOTIFICATION MODAL (Case 5-7)
============================================ */
.popup-notif {
    max-width: 380px;
    text-align: center;
    padding-bottom: 8px;
}

.popup-notif-icon {
    margin: 28px auto 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.popup-notif-icon .material-symbols-outlined { font-size: 36px; }

/* ============================================
   COUNTDOWN POPUP (Case 11)
============================================ */
.popup-countdown {
    max-width: 360px;
}

.countdown-display {
    font-size: 88px;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
    margin: 16px 0;
    font-feature-settings: "tnum";
    transition: all 0.3s;
}

/* ============================================
   CONTACT OPTIONS (Case 12)
============================================ */
.contact-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.contact-option-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 14px;
    padding: 16px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.contact-option-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(184, 255, 27, 0.08);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.contact-option-btn .material-symbols-outlined { font-size: 24px; }

/* ============================================
   TOAST NOTIFICATIONS
============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-variant);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 14px 18px;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    pointer-events: all;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    opacity: 0;
    font-size: 14px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon { font-size: 20px; }
.toast-success { border-left: 3px solid #48c78e; }
.toast-success .toast-icon { color: #48c78e; }
.toast-error   { border-left: 3px solid #ff5b5b; }
.toast-error .toast-icon { color: #ff5b5b; }
.toast-info    { border-left: 3px solid #63b3ed; }
.toast-info .toast-icon { color: #63b3ed; }
.toast-warning { border-left: 3px solid #ffbd2e; }
.toast-warning .toast-icon { color: #ffbd2e; }

.toast-msg { flex: 1; font-weight: 500; }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 0 0 0 14px;
    animation: toastProgress 3s linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
    .page-header-section { padding: 60px 24px 32px; }
    .page-title { font-size: 48px; }
    .demo-section { padding: 40px 24px; }
    .section-title { font-size: 28px; }
    .demo-grid { grid-template-columns: 1fr; }

    .popup-media {
        flex-direction: column;
        max-width: 90vw;
    }
    .popup-media-preview { width: 100%; min-width: unset; }
    .popup-info-cards { grid-template-columns: 1fr 1fr; }
    .popup-fullscreen { max-width: 100% !important; }
}
