/* Reset and Base Styles */
* {
    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;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Tabs Navigation */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.tab-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.tab-btn.active {
    background: #4CAF50;
    color: white;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Sections */
.form-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.full-width {
    grid-column: 1 / -1;
}

/* Generate Button */
.generate-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* QR Display */
.qr-display {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

#qr-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

#qr-canvas img, #qr-canvas canvas {
    display: block;
    margin: 0 auto;
}

.qr-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    word-break: break-all;
}

/* QR Controls */
.qr-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.control-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.control-group input,
.control-group select {
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

/* QR Actions */
.qr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

/* Social Media Options */
.social-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.social-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-option:hover {
    border-color: #4CAF50;
    background: #f8f9fa;
}

.social-option input[type="radio"] {
    width: auto;
    margin: 0;
}

.social-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 600;
}

.social-option i {
    font-size: 1.2rem;
}

/* Bulk Options */
.bulk-options {
    margin-bottom: 20px;
}

.bulk-options label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.bulk-options input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
}

/* Scanner Section */
.scanner-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.scanner-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

/* --- Scanner Section Fixes --- */
.scanner-container {
    position: relative;
    width: 100%;
    height: 350px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scanner-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    background: #000;
    border-radius: 16px;
    display: block;
    will-change: transform;
    transform: translateZ(0);
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    pointer-events: none;
    background: none !important;
}

.scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 2px solid #fff;
    border-radius: 10px;
    z-index: 3;
    background: none !important;
    box-shadow: none !important;
}

.scanner-frame::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: none !important;
    border-radius: 10px;
    animation: none !important;
    background: none !important;
}

.scanner-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.scanner-btn {
    background: linear-gradient(45deg, #FF9800, #F57C00);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.scanner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.scanner-btn:active {
    transform: translateY(0);
}

.scanner-result {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-top: 20px;
    word-break: break-all;
    border-left: 4px solid #4CAF50;
}

.scanner-result h4 {
    color: #4CAF50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scanner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.scanner-actions .action-btn {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scanner-actions .action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.3);
}

/* High-resolution scanner enhancements */
.resolution-info {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
}

.scanner-status {
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    position: absolute;
    bottom: 15px;
    left: 15px;
    z-index: 10;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 200px;
    word-wrap: break-word;
}

/* Scanner quality indicators */
.quality-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
}

.quality-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: qualityPulse 2s infinite;
}

@keyframes qualityPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Enhanced mobile responsiveness for scanner */
@media (max-width: 768px) {
    .scanner-container {
        max-width: 100%;
        margin: 0 auto 15px;
    }
    
    #scanner-video {
        height: 300px;
    }
    
    .scanner-frame {
        width: 200px;
        height: 200px;
    }
    
    .scanner-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .scanner-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .resolution-info,
    .scanner-status {
        font-size: 10px;
        padding: 8px 12px;
    }
    
    .scanner-actions {
        flex-direction: column;
    }
    
    .scanner-actions .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* High DPI display support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .scanner-frame {
        border-width: 2px;
    }
    
    .scanner-frame::before {
        border-width: 1px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .qr-controls {
        grid-template-columns: 1fr;
    }
    
    .qr-actions {
        flex-direction: column;
    }
    
    .social-options {
        grid-template-columns: 1fr;
    }
    
    .scanner-controls {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
    animation: fadeIn 0.3s ease;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #4CAF50;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification {
    animation: slideIn 0.3s ease;
}

.notification.removing {
    animation: slideOut 0.3s ease;
} 

@media screen and (max-width: 900px) and (orientation: portrait) {
    #scanner-video {
        position: absolute !important;
        z-index: 10 !important;
        background: #000 !important;
        will-change: transform;
        transform: translateZ(0);
    }
    .scanner-overlay, .scanner-frame {
        z-index: 20 !important;
    }
}