/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 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;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Header styles */
.header {
    text-align: center;
    padding: 40px 30px 30px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
}

.logo {
    font-size: 48px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.5;
}

/* QR Container styles */
.qr-container {
    padding: 40px 30px;
    text-align: center;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #25d366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qr-loading p {
    color: #666;
    font-size: 16px;
}

/* QR Code styles */
.qr-code {
    position: relative;
    display: inline-block;
}

.qr-code img {
    width: 250px;
    height: 250px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.qr-code img:hover {
    transform: scale(1.02);
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    overflow: hidden;
    pointer-events: none;
}

.scan-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #25d366, transparent);
    animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

/* Success styles */
.qr-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.success-icon {
    font-size: 60px;
    color: #25d366;
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.qr-success h3 {
    color: #25d366;
    font-size: 24px;
    font-weight: 600;
}

.qr-success p {
    color: #666;
    font-size: 16px;
}

/* Error styles */
.qr-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.error-icon {
    font-size: 60px;
    color: #ff6b6b;
}

.qr-error h3 {
    color: #ff6b6b;
    font-size: 24px;
    font-weight: 600;
}

.qr-error p {
    color: #666;
    font-size: 16px;
}

.retry-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Instructions styles */
.instructions {
    padding: 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.instructions h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.instructions ol {
    color: #666;
    line-height: 1.8;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
}

/* Status bar styles */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.status-item i {
    font-size: 12px;
}

.status-item i.fa-circle {
    color: #ffc107;
}

.status-item i.fa-circle.connected {
    color: #25d366;
}

.status-item i.fa-circle.error {
    color: #ff6b6b;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .card {
        border-radius: 15px;
    }
    
    .header {
        padding: 30px 20px 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .qr-container {
        padding: 30px 20px;
    }
    
    .qr-code img {
        width: 200px;
        height: 200px;
    }
    
    .instructions {
        padding: 20px;
    }
    
    .status-bar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }
    
    .qr-code img {
        width: 180px;
        height: 180px;
    }
    
    .success-icon,
    .error-icon {
        font-size: 50px;
    }
}
