/* ===============================
   CSS Variables & Reset
   =============================== */
:root {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --primary-light: rgba(249, 115, 22, 0.1);
    --secondary-color: #fb923c;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;

    --bg-dark: #431407;
    --bg-card: rgba(255, 255, 255, 0.1);
    --bg-card-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);

    --border-color: rgba(255, 255, 255, 0.2);
    --border-hover: rgba(255, 255, 255, 0.3);

    --gradient-primary: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    --gradient-bg: linear-gradient(135deg, #431407 0%, #7c2d12 50%, #431407 100%);

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(249, 115, 22, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: url('background.jpeg') no-repeat top center fixed;
    background-size: cover;
    background-color: var(--bg-dark);
    min-height: 100vh;
    min-height: 100dvh;
    /* Dynamic viewport height for mobile */
    display: flex;
    align-items: flex-start; /* Start from top to allow scrolling down */
    justify-content: center;
    padding: 16px;
    /* Removed large padding-top from body */
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated background */
/* Animated background removed to favor image background */
/* body::before { ... } */

/* ===============================
   Container & Card
   =============================== */
.container {
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.6s ease;
    margin-top: 400px; /* Desktop push down */
}

/* Mobile adjustments for background zoom and spacing */
@media (max-width: 480px) {
    body {
        /* Zoom out to show full text width without clipping */
        background-size: 100% auto; 
        background-color: #d1785f; /* Fallback warm color for bottom gap */
    }
    .container {
        margin-top: 35vh; /* Moved up to 50% of the previous distance below text */
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.payment-card {
    background: rgba(255, 255, 255, 0.05); /* Even more transparent */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ===============================
   Header Section
   =============================== */
.header {
    text-align: center;
    margin-bottom: 28px;
}

.logo-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 14px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    animation: pulse 2s infinite;
    overflow: hidden;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: var(--shadow-md);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
    }
}

.camera-icon {
    font-size: 32px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

/* ===============================
   Amount Section
   =============================== */
.amount-section {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    margin-bottom: 28px;
}

.amount-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.amount-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.currency {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-secondary);
}

.amount {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===============================
   Payment Methods
   =============================== */
.payment-methods h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 14px;
    text-align: center;
}

.methods-grid {
    display: grid;
    gap: 10px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.payment-method::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.payment-method:hover,
.payment-method:active {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.payment-method:hover::before,
.payment-method:active::before {
    opacity: 0.1;
}

.method-icon {
    width: 44px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-sm);
    padding: 4px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.method-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.method-icon.placeholder {
    background: var(--gradient-primary);
    font-size: 18px;
}

.method-details {
    flex: 1;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.method-name {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.method-fee {
    font-size: 12px;
    color: var(--text-muted);
}

.method-arrow {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    position: relative;
    z-index: 1;
    font-size: 18px;
}

.payment-method:hover .method-arrow {
    transform: translateX(4px);
    color: var(--primary-color);
}

/* ===============================
   Loading & Error States
   =============================== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px;
    color: var(--text-secondary);
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner.large {
    width: 44px;
    height: 44px;
    border-width: 4px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    text-align: center;
}

.error-icon {
    font-size: 28px;
}

.error-text {
    color: var(--error-color);
    font-size: 14px;
}

.retry-btn {
    padding: 10px 20px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.retry-btn:hover,
.retry-btn:active {
    background: #dc2626;
    transform: translateY(-1px);
}

/* ===============================
   Loading Overlay
   =============================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-content p {
    margin-top: 14px;
    font-size: 15px;
}

/* ===============================
   Footer
   =============================== */
.footer {
    margin-top: 28px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.footer p {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.myfatoorah-logo {
    height: 20px;
    opacity: 0.7;
    filter: brightness(0) invert(1);
}

.myfatoorah-text {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===============================
   Mobile Responsive - Small Phones
   =============================== */
@media (max-width: 380px) {
    html {
        font-size: 14px;
    }

    body {
        padding: 12px;
    }

    .payment-card {
        padding: 20px 16px;
        border-radius: var(--radius-lg);
    }

    .logo-container {
        width: 60px;
        height: 60px;
    }

    .camera-icon {
        font-size: 26px;
    }

    .header h1 {
        font-size: 20px;
    }

    .amount {
        font-size: 36px;
    }

    .currency {
        font-size: 16px;
    }

    .payment-method {
        padding: 12px 14px;
        gap: 12px;
    }

    .method-icon {
        width: 40px;
        height: 26px;
    }

    .method-name {
        font-size: 14px;
    }
}

/* ===============================
   Mobile Responsive - Medium Phones
   =============================== */
@media (max-width: 480px) {
    body {
        padding: 12px;
        align-items: flex-start;
        padding-top: 24px;
    }

    .container {
        max-width: 100%;
    }

    .payment-card {
        padding: 24px 20px;
        border-radius: var(--radius-lg);
    }

    .logo-container {
        width: 64px;
        height: 64px;
    }

    .camera-icon {
        font-size: 28px;
    }

    .header h1 {
        font-size: 22px;
    }

    .amount {
        font-size: 38px;
    }

    .payment-method {
        padding: 14px 16px;
    }
}

/* ===============================
   Safe Area for Notched Phones
   =============================== */
@supports (padding: max(0px)) {
    body {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}