* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 8px;
    font-size: 2.2rem;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.result-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.result-section h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.intent-display {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

#intentUri {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    background-color: white;
    word-break: break-all;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.copy-btn,
.qr-btn,
.pay-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 120px;
}

.copy-btn {
    background: #28a745;
    color: white;
}

.copy-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.qr-btn {
    background: #17a2b8;
    color: white;
}

.qr-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

.pay-btn {
    background: #fd7e14;
    color: white;
    display: inline-block;
}

.pay-btn:hover {
    background: #e8690b;
    transform: translateY(-1px);
    text-decoration: none;
}

.qr-section {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.qr-section h4 {
    margin-bottom: 15px;
    color: #333;
}

#qrcode {
    display: inline-block;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .card {
        padding: 25px;
        margin: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .copy-btn,
    .qr-btn,
    .pay-btn {
        flex: none;
        width: 100%;
    }
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading .submit-btn {
    background: #ccc;
    cursor: not-allowed;
}

/* Input Validation States */
.input-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.input-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

/* iOS-specific UPI App Buttons */
.ios-app-buttons {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.ios-app-buttons h4 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
    font-size: 1.1rem;
}

.ios-app-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
}

.ios-app-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.ios-app-btn:active {
    transform: translateY(0);
}

.ios-app-btn .app-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.ios-app-btn .app-name {
    flex: 1;
    text-align: center;
}

/* iOS Safari specific optimizations */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    input[type="text"],
    input[type="number"] {
        -webkit-appearance: none;
        border-radius: 12px;
    }
    
    button {
        -webkit-appearance: none;
        border-radius: 12px;
    }
    
    /* Fix for iOS viewport issues */
    .container {
        -webkit-text-size-adjust: 100%;
    }
    
    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="number"] {
        font-size: 16px;
    }
}

/* Mobile-first responsive design for iOS */
@media screen and (max-width: 480px) {
    .ios-app-buttons {
        margin: 15px -10px 0 -10px;
        border-radius: 8px;
    }
    
    .ios-app-btn {
        margin-bottom: 8px;
        padding: 15px 20px;
        font-size: 1.1rem;
    }
    
    /* Larger touch targets for mobile */
    .copy-btn,
    .qr-btn,
    .pay-btn {
        min-height: 48px;
        font-size: 1rem;
    }
}
