/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header .logo {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

header h1 {
    font-size: 2rem;
    margin: 0;
}

/* Main Content */
main {
    padding: 40px;
}

/* Explainer Section */
.explainer {
    background: #f8f9ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 6px;
}

.explainer p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #4caf50;
    color: white;
    width: 100%;
}

.btn-secondary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Loading Animation */
.btn-primary.loading {
    position: relative;
    pointer-events: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Output Section */
.output-section {
    text-align: center;
    margin-top: 30px;
}

.qr-display {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.qr-display canvas {
    max-width: 100%;
    height: auto;
}

.qr-display:empty::before {
    content: 'Your QR code will appear here';
    color: #999;
    font-style: italic;
}

/* Message Area */
.message-area {
    margin-top: 20px;
}

.message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 15px;
        gap: 10px;
    }
    
    header .logo {
        width: 40px;
        height: 40px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 20px;
    }
    
    .explainer {
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .qr-display {
        min-height: 150px;
        padding: 15px;
    }
}
