/**
 * QR Code Reader
 * Generated by Cursor AI
 * 
 * This stylesheet is for the QR code reader.
 * 
 * It uses the Inter font.
 */
* {
    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;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

main {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.input-section {
    margin-bottom: 40px;
}

.input-methods {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.result-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.image-container, .content-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e9ecef;
}

.image-container h3, .content-container h3 {
    margin-bottom: 20px;
    color: #495057;
    font-weight: 600;
    font-size: 1.2rem;
}

.image-wrapper {
    text-align: center;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.content-wrapper {
    position: relative;
}

.qr-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-all;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.qr-content.has-content {
    color: #333;
    text-align: left;
    align-items: flex-start;
}

#copyBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#copyBtn:hover {
    opacity: 1;
}

.camera-section {
    text-align: center;
}

.camera-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#cameraVideo {
    width: 100%;
    height: auto;
    display: block;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-area {
    width: 200px;
    height: 200px;
    border: 3px solid #fff;
    border-radius: 15px;
    position: relative;
    animation: scan 2s ease-in-out infinite;
    opacity: 0.3;
}

.scan-area::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 3px solid transparent;
    border-radius: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    background-size: 200% 200%;
    animation: borderGlow 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes scan {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

.camera-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
    margin-top: 20px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    main {
        padding: 25px;
    }
    
    .input-methods {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .result-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .camera-container {
        max-width: 100%;
    }
    
    .scan-area {
        width: 150px;
        height: 150px;
    }
    
    .camera-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .camera-controls .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 20px;
    }
    
    .image-container, .content-container {
        padding: 20px;
    }
    
    .qr-content {
        font-size: 0.8rem;
        padding: 15px;
    }

    .generate-container {
        padding: 20px;
    }

    .input-controls {
        flex-direction: column;
        align-items: center;
    }

    .input-controls .btn {
        width: 100%;
        max-width: 300px;
    }

    .export-controls {
        flex-direction: column;
        align-items: center;
    }

    .export-controls .btn {
        width: 100%;
        max-width: 300px;
    }

    #qrCanvas {
        max-width: 100%;
        height: auto;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success animation */
.success {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Drop Zone Styles */
.drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border: 4px dashed rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.drop-zone.active {
    display: flex;
    animation: dropZonePulse 0.6s ease-in-out;
}

.drop-zone-content {
    text-align: center;
    color: white;
    padding: 40px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.drop-zone-content svg {
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

.drop-zone-content h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.drop-zone-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

@keyframes dropZonePulse {
    0% { 
        opacity: 0;
        transform: scale(0.9);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* QR Code Generation Styles */
.generate-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.generate-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.input-container h3 {
    margin-bottom: 20px;
    color: #495057;
    font-weight: 600;
    font-size: 1.3rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#qrInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s ease;
}

#qrInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.qr-preview-container {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.qr-preview-container h3 {
    margin-bottom: 20px;
    color: #495057;
    font-weight: 600;
    font-size: 1.3rem;
}

.qr-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#qrCanvas {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background: white;
}

.export-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.base64-display {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.base64-display h4 {
    margin-bottom: 10px;
    color: #495057;
    font-weight: 600;
}

#base64Textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    resize: vertical;
    background: #f8f9fa;
}

.generate-controls {
    display: flex;
    justify-content: center;
} 
