/* Enhanced form styles with better image handling feedback */
.lorry-submission-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lorry-submission-wrapper .submission-title {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 50px;
    color: #333;
    font-size: 28px;
}

.lorry-submission-wrapper .form-section {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lorry-submission-wrapper .section-title {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.lorry-submission-wrapper .section-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.lorry-submission-wrapper .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.lorry-submission-wrapper .form-group {
    flex: 1;
}

.lorry-submission-wrapper .form-group.half {
    flex: 0 0 calc(50% - 10px);
}

.lorry-submission-wrapper .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.lorry-submission-wrapper .required {
    color: #e74c3c;
}

.lorry-submission-wrapper .form-group input,
.lorry-submission-wrapper .form-group select,
.lorry-submission-wrapper .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.lorry-submission-wrapper .form-group input:focus,
.lorry-submission-wrapper .form-group select:focus,
.lorry-submission-wrapper .form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.lorry-submission-wrapper .form-group.error input,
.lorry-submission-wrapper .form-group.error select,
.lorry-submission-wrapper .form-group.error textarea {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.lorry-submission-wrapper .form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.lorry-submission-wrapper .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.lorry-submission-wrapper .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
}

.lorry-submission-wrapper .checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.lorry-submission-wrapper .terms-label {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Enhanced image upload area */
.lorry-submission-wrapper .image-upload-container {
    margin-top: 20px;
}

.lorry-submission-wrapper .upload-area {
    border: 3px dashed #3498db !important;
    border-radius: 12px !important;
    padding: 40px 20px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    position: relative !important;
    min-height: 150px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    user-select: none !important;
}

.lorry-submission-wrapper .upload-area:hover {
    border-color: #2980b9 !important;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3) !important;
}

.lorry-submission-wrapper .upload-area.dragover {
    border-color: #27ae60 !important;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%) !important;
    box-shadow: 0 8px 30px rgba(39, 174, 96, 0.4) !important;
    transform: scale(1.02) !important;
}

.lorry-submission-wrapper .upload-placeholder {
    color: #495057 !important;
    pointer-events: none !important;
    font-size: 16px !important;
}

.lorry-submission-wrapper .upload-placeholder p {
    margin: 8px 0 !important;
    line-height: 1.4 !important;
}

.lorry-submission-wrapper .upload-placeholder strong {
    color: #2980b9 !important;
    font-weight: 600 !important;
}

.lorry-submission-wrapper .upload-icon {
    font-size: 64px !important;
    display: inline-block !important;
    margin-bottom: 20px !important;
    line-height: 1 !important;
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
    color: #3498db !important;
    animation: gentlePulse 2s ease-in-out infinite !important;
    text-shadow: 0 2px 4px rgba(52, 152, 219, 0.3) !important;
}

/* Remove animation if still causing issues */
.lorry-submission-wrapper .upload-icon.no-animation {
    animation: none !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
    transition: none !important;
    font-style: normal !important;
    text-decoration: none !important;
    outline: none !important;
    display: inline !important;
    width: auto !important;
    height: auto !important;
    line-height: normal !important;
}

.lorry-submission-wrapper .upload-icon.no-animation:hover {
    animation: none !important;
    transform: none !important;
    transition: none !important;
    background: none !important;
    box-shadow: none !important;
}

@keyframes gentlePulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.7;
    }
}

.lorry-submission-wrapper .upload-note {
    font-size: 13px !important;
    color: #6c757d !important;
    margin-top: 10px !important;
}

/* Progress overlay with better styling */
.lorry-submission-wrapper .upload-progress-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(52, 152, 219, 0.95) !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100 !important;
}

.lorry-submission-wrapper .progress-content {
    color: white !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    text-align: center !important;
}

.lorry-submission-wrapper .progress-spinner {
    width: 24px !important;
    height: 24px !important;
    border: 3px solid rgba(255,255,255,0.3) !important;
    border-top: 3px solid white !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    margin: 15px auto 0 !important;
}

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

.lorry-submission-wrapper .progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
}

.lorry-submission-wrapper .progress-fill {
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Enhanced uploaded images display with drag and drop */
.lorry-submission-wrapper .uploaded-images {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 25px !important;
    padding: 20px !important;
    background: #f8f9fa !important;
    border-radius: 12px !important;
    border: 1px solid #dee2e6 !important;
}

.lorry-submission-wrapper .uploaded-image {
    position: relative !important;
    width: 100% !important;
    height: 140px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 3px solid #e9ecef !important;
    transition: all 0.3s ease !important;
    background: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    cursor: move !important;
}

.lorry-submission-wrapper .uploaded-image:hover {
    border-color: #007bff !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.lorry-submission-wrapper .uploaded-image.dragging {
    opacity: 0.3 !important;
    transform: rotate(5deg) scale(1.05) !important;
    z-index: 1000 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
}

/* Drag and drop indicators */
.lorry-submission-wrapper .uploaded-image.drag-over-left {
    border-left: 4px solid #28a745 !important;
    background: linear-gradient(90deg, rgba(40,167,69,0.1) 0%, transparent 20%) !important;
}

.lorry-submission-wrapper .uploaded-image.drag-over-right {
    border-right: 4px solid #28a745 !important;
    background: linear-gradient(270deg, rgba(40,167,69,0.1) 0%, transparent 20%) !important;
}

/* Drag handle */
.lorry-submission-wrapper .drag-handle {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    background: rgba(0,0,0,0.85) !important;
    color: white !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: bold !important;
    cursor: grab !important;
    z-index: 20 !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    user-select: none !important;
    line-height: 1 !important;
}

.lorry-submission-wrapper .uploaded-image:hover .drag-handle {
    opacity: 1 !important;
}

.lorry-submission-wrapper .drag-handle:active {
    cursor: grabbing !important;
    background: rgba(0,0,0,1) !important;
}

.lorry-submission-wrapper .uploaded-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.lorry-submission-wrapper .uploaded-image:hover img {
    transform: scale(1.05) !important;
}

.lorry-submission-wrapper .uploaded-image.dragging img {
    pointer-events: none !important;
}

/* Image actions visibility */
.lorry-submission-wrapper .image-actions {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    display: flex !important;
    gap: 5px !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    z-index: 10 !important;
}

.lorry-submission-wrapper .uploaded-image:hover .image-actions {
    opacity: 1 !important;
}

.lorry-submission-wrapper .remove-image {
    background: rgba(0,0,0,0.85) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    line-height: 1 !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.lorry-submission-wrapper .remove-image:hover {
    background: #ffc107 !important;
    transform: scale(1.1) !important;
}

.lorry-submission-wrapper .main-image-badge {
    position: absolute !important;
    bottom: 8px !important;
    left: 8px !important;
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 15px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    box-shadow: 0 2px 8px rgba(40,167,69,0.4) !important;
    letter-spacing: 0.5px !important;
}

/* Image preview modal */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9) !important;
    z-index: 1 !important;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 10 !important;
}

.modal-content img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    z-index: 5 !important;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8) !important;
    color: white !important;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 20 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(220, 53, 69, 0.9) !important;
}

.modal-title {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-weight: 600;
    color: #333;
    z-index: 5 !important;
}

/* Submit button styling */
.lorry-submission-wrapper .submit-container {
    text-align: center;
    margin-top: 30px;
}

.lorry-submission-wrapper .submit-button {
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.lorry-submission-wrapper .submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}

.lorry-submission-wrapper .submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.lorry-submission-wrapper .submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lorry-submission-wrapper .submit-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced message styling */
.lorry-submission-wrapper .submission-messages {
    margin-bottom: 20px;
}

.lorry-submission-wrapper .message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid;
}

.lorry-submission-wrapper .message.success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.lorry-submission-wrapper .message.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.lorry-submission-wrapper .message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

/* Success overlay animation */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(219, 118, 51, 0.95);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

.success-content {
    text-align: center;
    color: white;
    animation: slideIn 0.5s ease 0.2s both;
}

.success-checkmark {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounceIn 0.8s ease 0.3s both;
}

.success-content h3 {
    font-size: 28px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.success-content p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Mobile: Always show buttons */
@media (max-width: 768px) {
    .lorry-submission-wrapper {
        padding: 10px;
    }
    
    .lorry-submission-wrapper .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .lorry-submission-wrapper .form-group.half {
        flex: 1;
    }
    
    .lorry-submission-wrapper .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .lorry-submission-wrapper .uploaded-images {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 15px !important;
        padding: 15px !important;
    }
    
    .lorry-submission-wrapper .uploaded-image {
        height: 100px !important;
    }
    
    .lorry-submission-wrapper .upload-area {
        padding: 30px 15px !important;
        min-height: 120px !important;
    }
    
    .lorry-submission-wrapper .upload-icon {
        font-size: 48px !important;
        margin-bottom: 15px !important;
    }
    
    .lorry-submission-wrapper .image-actions {
        opacity: 1 !important;
    }
    
    .lorry-submission-wrapper .drag-handle {
        opacity: 1 !important;
    }
    
    .lorry-submission-wrapper .remove-image {
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 20px;
    }

    .success-checkmark {
        font-size: 60px;
    }

    .success-content h3 {
        font-size: 24px;
    }
}

/* Submission Limit Notice Styles */
.submission-limit-notice {
    background: #e7f3ff;
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.submission-limit-notice.success {
    background: #d4edda;
    border-left-color: #27ae60;
    color: #155724;
}

.submission-limit-notice.error {
    background: #f8d7da;
    border-left-color: #e74c3c;
    color: #721c24;
}

.submission-limit-notice p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.submission-limit-notice strong {
    font-weight: 600;
    display: inline-block;
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    .submission-limit-notice {
        padding: 12px 15px;
        margin: 15px 0;
    }

    .submission-limit-notice p {
        font-size: 13px;
    }
}