﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Light theme */
    --primary-color: #6366f1;
    --primary-hover: #5855eb;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.95);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: rgba(226, 232, 240, 0.8);
    --border-hover: rgba(148, 163, 184, 0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
}

[data-theme="dark"] {
    /* Microsoft Office inspired dark theme */
    --bg-primary: #2b2b2b;
    --bg-secondary: #3c3c3c;
    --bg-tertiary: #404040;
    --bg-card: rgba(43, 43, 43, 0.95);
    --text-primary: #ffffff;
    --text-secondary: #d4d4d4;
    --text-tertiary: #969696;
    --border-color: rgba(96, 96, 96, 0.6);
    --border-hover: rgba(130, 130, 130, 0.8);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-height: 600px) {
    body {
        align-items: flex-start;
    }
}

.container-fluid {
    padding: 0.75rem;
    max-width: 100%;
    margin: 0;
}

.main-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    transition: max-width 0.3s ease;
}

@media (min-width: 768px) {
    .main-card {
        max-width: 700px;
    }
}

@media (min-width: 1200px) {
    .main-card {
        max-width: 700px;
    }
}

/* === HEADER === */
.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden; /* shimmer */
}

    .card-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
        transform: translateX(-100%);
        animation: shimmer 3s infinite;
        z-index: 0;
        pointer-events: none;
    }

    .card-header * {
        position: relative;
        z-index: 1;
    }

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
    background: linear-gradient(45deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 400;
    margin: 0;
}

/* Capsule header actions */
.header-actions {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    z-index: 2;
}

    .header-actions .env-label {
        padding: 0.1rem 0.4rem;
        border-radius: 999px;
        font-size: 0.75rem;
        font-weight: 500;
        white-space: nowrap;
        color: white;
    }

    .header-actions .header-btn {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }

        .header-actions .header-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.05);
        }

        .header-actions .header-btn i {
            font-size: 0.8rem;
            color: white;
        }

.env-sandbox {
    background: rgba(0, 123, 255, 0.25);
    border: 1px solid rgba(0, 123, 255, 0.4);
}

.env-production {
    background: rgba(220, 53, 69, 0.25);
    border: 1px solid rgba(220, 53, 69, 0.4);
}

/* === BODY & CONTENT === */
.card-body {
    padding: 1rem;
}

.status-card {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

/*.status-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }*/

.status-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
    border-color: var(--warning-color);
}

.status-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    border-color: var(--success-color);
}

.notInIframe {
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--warning-color);
}

    .notInIframe i {
        font-size: 2rem;
        opacity: 0.7;
    }

/* QR Code */
#reportedQrWrapper {
    background: var(--bg-primary);
    border: 2px solid var(--success-color);
    border-radius: 8px;
    padding: 0.5rem;
    display: inline-block;
    box-shadow: var(--shadow-md);
}

#reportedQrContainer {
    background: white;
    border-radius: 4px;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-flex {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .qr-flex img,
    #reportedQrContainer {
        width: 120px;
        height: 120px;
        object-fit: contain;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: #fff;
        box-shadow: var(--shadow-sm);
    }

.invoice-badge {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.8rem;
    box-shadow: var(--shadow-sm);
    margin-top: 0.75rem;
    display: inline-block;
}

/* Tabs */
.nav-tabs {
    border: none;
    margin-bottom: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 0.125rem;
    display: flex;
    flex-wrap: wrap;
}

    .nav-tabs .nav-link {
        border: none;
        background: transparent;
        color: var(--text-secondary);
        font-weight: 500;
        padding: 0.4rem 0.75rem;
        border-radius: 4px;
        transition: all 0.2s ease;
        font-size: 0.8rem;
        flex: 1;
        text-align: center;
        white-space: nowrap;
        min-width: 0;
    }

        .nav-tabs .nav-link:hover {
            background: var(--bg-primary);
            color: var(--text-primary);
        }

        .nav-tabs .nav-link.active {
            background: var(--primary-color);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .nav-tabs .nav-link i {
            margin-right: 0.3rem;
            font-size: 0.75rem;
        }

/* Form Controls */
.form-control, .form-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    line-height: 1.3;
}

    .form-control:focus, .form-select:focus {
        background: var(--bg-primary);
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
        color: var(--text-secondary);
        outline: none;
    }

    .form-control::placeholder {
        color: var(--text-tertiary);
        font-size: 0.8rem;
    }

textarea.form-control {
    min-height: 220px;
    font-family: 'Consolas', 'Monaco', 'Courier New', 'monospace';
    font-size: 0.8rem;
    line-height: 1.4;
    resize: vertical;
    color: var(--text-secondary);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

.form-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.75rem;
    box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-weight: 500;
    font-size: 0.8rem;
    border: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

    .btn:hover {
        transform: translateY(-1px);
    }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

    .btn-outline-primary:hover {
        background: var(--primary-color);
        color: white;
    }

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

    .btn-secondary:hover {
        background: var(--text-tertiary);
        color: white;
    }

.btn i {
    font-size: 0.75rem;
}

.btn-group-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-group-right {
    display: flex;
    gap: 0.4rem;
}

/* Show/Hide */
.show-hide {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .show-hide.active {
        display: block !important;
        opacity: 1;
    }

/* Grid */
.row {
    margin: 0 -0.375rem;
}

.col-md-6, .col-sm-6 {
    padding: 0 0.375rem;
    margin-bottom: 0.75rem;
}

/* Business Info */
.business-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.business-info-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.server-info {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0.5rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .nav-tabs .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        flex: 1;
        min-width: 80px;
    }

        .nav-tabs .nav-link i {
            display: none;
        }

    .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .form-control, .form-select {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }

    textarea.form-control {
        min-height: 120px;
        font-size: 0.7rem;
    }

    .form-label {
        font-size: 0.75rem;
    }

    .form-section {
        padding: 0.75rem;
    }

    .btn-group-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group-right {
        width: 100%;
        justify-content: center;
    }

    .business-info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .col-md-6 {
        width: 100%;
    }

    #reportedQrContainer {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .container-fluid {
        padding: 0.25rem;
    }

    .main-card {
        border-radius: 8px;
    }

    .card-header {
        padding: 0.75rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-subtitle {
        font-size: 0.75rem;
    }

    .card-body {
        padding: 0.5rem;
    }

    .card-footer {
        padding: 0.5rem;
    }

    .nav-tabs .nav-link {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
    }

    .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    .btn-group-right .btn {
        flex: 1;
    }
}

/* Loading state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading {
    pointer-events: none;
}

/* Animations */
/*@keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .fade-in {
            animation: fadeIn 0.3s ease;
        }*/

@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* === FOOTER === */
.card-footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.footer-capsule {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

    .footer-capsule i {
        font-size: 0.8rem;
        color: var(--primary-color);
    }

/* === Base Theme === */
.swal2-popup {
    border-radius: 12px;
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    background: var(--bg-card);
    color: var(--text-secondary) !important;
    font-size: 1em !important;
    font-weight: 300 !important;
}

/* === Icon & SVG Fix === */
.swal2-icon {
    font-size: 0.5rem; /* kecilkan icon */
    line-height: 1em;
    margin: 0.3rem auto;
}

    .swal2-icon svg {
        width: 100%;
        height: 100%;
        object-fit: contain; /* perbaiki tampilan SVG */
    }

/* === Typography === */
.swal2-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0;
    line-height: 1.2;
}

.swal2-text {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* === Actions & Focus === */
.swal2-actions {
    margin-top: 1rem;
    gap: 0.5rem;
}

    .swal2-actions button:focus-visible {
        outline: 2px solid var(--info-color);
        outline-offset: 2px;
    }

/* === Status Variants === */
/* === Status Variants: border + title color === */
.swal2-popup.swal2-icon-success {
    border-left: 5px solid var(--success-color);
}

    .swal2-popup.swal2-icon-success .swal2-title {
        color: var(--success-color);
    }

.swal2-popup.swal2-icon-error {
    border-left: 5px solid var(--danger-color);
}

    .swal2-popup.swal2-icon-error .swal2-title {
        color: var(--danger-color);
    }

.swal2-popup.swal2-icon-warning {
    border-left: 5px solid var(--warning-color);
}

    .swal2-popup.swal2-icon-warning .swal2-title {
        color: var(--warning-color);
    }

.swal2-popup.swal2-icon-info {
    border-left: 5px solid var(--info-color);
}

    .swal2-popup.swal2-icon-info .swal2-title {
        color: var(--info-color);
    }

/* === Toast === */
.swal2-toast.swal2-popup {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border-left-width: 4px;
    box-shadow: var(--shadow-md);
}

.swal2-toast .swal2-icon {
    font-size: 1.25rem;
    width: 1.75em;
    height: 1.75em;
}

.swal2-toast .swal2-title {
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.2;
}

.swal2-toast .swal2-text {
    font-size: 0.7rem;
}

code {
    font-size: 1.2em;
    color: #09e9d5;
    word-wrap: break-word;
}
