@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #1e3a8a; /* Deep Blue */
    --primary-bg: #f8fafc;
    --accent: #e91e63; /* DuitNow Magenta */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --surface: #ffffff;
    --glass: rgba(255, 255, 255, 0.8);
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 16px;
    --shimmer-gradient: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
}

@keyframes shimmer {
    0% { transform: translateX(-150%); }
    100% { transform: translateX(150%); }
}

@keyframes rotateBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: 40px;
}

/* Header & Glassmorphism */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
}

.logo img {
    height: 32px;
}

/* Language Selector */
.lang-selector {
    position: relative;
}

.lang-btn {
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* Timer Section with Circular Progress */
.timer-container {
    padding: 24px 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.circular-timer {
    position: relative;
    width: 100px;
    height: 100px;
}

.circular-timer svg {
    transform: rotate(-90deg);
}

.circular-timer circle {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
}

.bg-circle {
    stroke: #e2e8f0;
}

.progress-circle {
    stroke: var(--accent);
    stroke-dasharray: 283; /* 2 * PI * 45 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 700;
}

.alert-banner {
    background: #fff1f2;
    color: #be123c;
    margin: 12px 16px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #fecdd3;
    animation: fadeIn 0.5s ease-out;
}

/* QR Card */
.payment-card {
    background: var(--surface);
    margin: 16px;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Animated Gradient Border Effect */
    border: 2px solid transparent;
    background-image: linear-gradient(white, white), 
                      linear-gradient(45deg, var(--primary), var(--accent), var(--primary));
    background-origin: border-box;
    background-clip: content-box, border-box;
    background-size: 200% 200%;
    animation: rotateBorder 5s linear infinite;
}

.duitnow-header {
    background: var(--accent);
    color: white;
    padding: 10px;
    border-radius: 10px 10px 0 0;
    margin: -24px -24px 20px -24px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.qr-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 1px dashed #cbd5e1;
}

.qr-placeholder img {
    max-width: 90%;
    height: auto;
}

.amount-display {
    padding: 16px;
    background: #f1f5f9;
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.shimmer-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--shimmer-gradient);
    animation: shimmer 2.5s infinite linear;
    pointer-events: none;
}

.amount-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.amount-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.btn-download {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.btn-download:active {
    transform: scale(0.98);
}

/* Instructions */
.instructions {
    margin: 24px 16px;
}

.instructions h3 {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.instruction-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    animation: fadeInUp 0.6s ease-out both;
}

.instruction-item:nth-child(1) { animation-delay: 0.1s; }
.instruction-item:nth-child(2) { animation-delay: 0.2s; }
.instruction-item:nth-child(3) { animation-delay: 0.3s; }

.step-num {
    background: var(--primary-bg);
    color: var(--primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.step-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Footer / Modal Trigger */
footer {
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
}

.tc-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.close-modal {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-content {
    max-height: 60vh;
    overflow-y: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
