/* Upload Section */
.upload-section {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    padding: 48px;
    border-radius: 24px;
    box-shadow: 
        0 24px 48px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    margin-bottom: 32px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.upload-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

/* Upload Counter */
.upload-info {
    margin-bottom: 20px;
    text-align: center;
}

.upload-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    background: linear-gradient(135deg, #e8f5e8 0%, #d5f4e6 100%);
    border: 2px solid #27ae60;
    color: #155724;
}

.upload-counter.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #f39c12;
    color: #856404;
}

.upload-counter.limit-reached {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #e74c3c;
    color: #721c24;
}

.counter-icon {
    font-size: 1.1rem;
}

.upload-options {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    justify-content: center;
    align-items: baseline;
}

.upload-option {
    flex: 1;
}

/* Hide the default file input */
input[type="file"] {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.upload-btn, .camera-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #ced4da;
    border-radius: 8px;
    color: #495057;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.upload-btn:hover, .camera-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-2px);
}

.camera-icon, .capture-icon, .retake-icon, .confirm-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

.file-preview {
    margin-top: 15px;
    text-align: center;
}

.file-preview img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    border: 2px solid #e1e8ed;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Camera Modal */
.camera-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    overflow: auto;
}

.camera-modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 25px;
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
}

.close-camera-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-camera-modal:hover {
    color: #333;
}

.camera-container {
    width: 100%;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    position: relative;
}

#cameraFeed, #cameraCanvas {
    width: 100%;
    max-height: 70vh;
    object-fit: cover;
    display: block;
}

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

.capture-btn, .retake-btn, .confirm-btn {
    padding: 12px 25px;
    border-radius: 30px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.capture-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.retake-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.confirm-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.capture-btn:hover, .retake-btn:hover, .confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.camera-instructions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #3498db;
}

/* Result Sections */
.result-section, .error-section, .success-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-section h2 {
    color: #27ae60;
    margin-bottom: 30px;
}

.error-section h2 {
    color: #e74c3c;
    margin-bottom: 20px;
}

.success-section h2 {
    color: #27ae60;
    margin-bottom: 20px;
}

/* Link Cards */
.link-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: left;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.link-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.link-display {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.link-display input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
}

.link-display button {
    padding: 8px 16px;
    font-size: 14px;
}


#upload-file-btn {
    font-weight: 500;
    font-size: 1rem;
    align-items: center;
    display: flex;
    justify-content: center;
    /*TODO: check padding */
    padding: 8px 20px;
}

/* iOS-specific styles for full-width upload button */
.upload-options.ios-single-option {
    justify-content: stretch;
}

.upload-options.ios-single-option .upload-option {
    flex: none;
    width: 100%;
}

#upload-file-btn.ios-full-width {
    width: 100%;
}

#upload-file-btn.ios-full-width:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 16px 48px rgba(0, 122, 255, 0.4),
        0 4px 16px rgba(0, 122, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}