/**
 * Monolox Dropzone - Frontend Styles
 * Version: 6.0
 */

/* Container */
.monolox-dropzone-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Upload Form */
.monolox-upload-form {
    background: #f8f9fa;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.monolox-upload-form h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.monolox-form-group {
    margin-bottom: 18px;
}

.monolox-form-group:last-child {
    margin-bottom: 0;
}

.monolox-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #495057;
}

.monolox-form-group label .required {
    color: #e74c3c;
}

.monolox-form-group input,
.monolox-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.monolox-form-group input:focus,
.monolox-form-group textarea:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.monolox-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.monolox-form-group small {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #6c757d;
}

/* Dropzone Area */
.monolox-dropzone {
    position: relative;
    border: 2px dashed #0087F7;
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.monolox-dropzone:hover {
    background: #f0f8ff;
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 135, 247, 0.1);
}

.monolox-dropzone.dz-drag-hover {
    background: #e3f2fd;
    border-color: #0056b3;
    border-style: solid;
}

.monolox-dropzone.dz-started .monolox-dropzone-content {
    display: none;
}

/* Dropzone Content */
.monolox-dropzone-content {
    pointer-events: none;
}

.monolox-dropzone-icon {
    font-size: 72px;
    margin-bottom: 15px;
    line-height: 1;
}

.monolox-dropzone-text h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.monolox-dropzone-text p {
    margin: 0;
    font-size: 16px;
    color: #6c757d;
}

.monolox-dropzone-info {
    margin-top: 20px;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.6;
}

/* File Preview */
.dz-preview {
    display: inline-block;
    margin: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
    text-align: center;
    min-width: 120px;
    max-width: 150px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.dz-preview:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.dz-preview.dz-processing {
    border-color: #0087F7;
}

.dz-preview.dz-success {
    border-color: #28a745;
}

.dz-preview.dz-error {
    border-color: #dc3545;
}

/* Hide default image preview */
.dz-preview .dz-image {
    display: none !important;
}

/* File Icon */
.dz-preview .file-icon {
    font-size: 48px;
    margin-bottom: 8px;
    display: block;
}

/* File Details */
.dz-preview .dz-details {
    opacity: 1 !important;
    text-align: center;
}

.dz-preview .dz-filename {
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.dz-preview .dz-size {
    font-size: 11px;
    color: #6c757d;
}

/* Progress Bar */
.dz-preview .dz-progress {
    height: 4px;
    background: #e9ecef;
    margin-top: 10px;
    border-radius: 2px;
    overflow: hidden;
}

.dz-preview .dz-upload {
    display: block;
    height: 100%;
    background: #0087F7;
    width: 0;
    transition: width 0.3s;
    border-radius: 2px;
}

/* Remove Link */
.dz-preview .dz-remove {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #dc3545;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

.dz-preview:hover .dz-remove {
    opacity: 1;
}

.dz-preview .dz-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Error Message */
.dz-preview .dz-error-message {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.dz-preview.dz-error .dz-error-message {
    display: block;
}

.dz-preview .dz-error-message:before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #dc3545 transparent;
}

/* Success/Error Marks */
.dz-preview .dz-success-mark,
.dz-preview .dz-error-mark {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.dz-preview.dz-success .dz-success-mark {
    display: block;
    animation: fadeInScale 0.3s ease-out forwards;
}

.dz-preview.dz-error .dz-error-mark {
    display: block;
    animation: fadeInScale 0.3s ease-out forwards;
}

/* Captcha Section */
.monolox-captcha {
    background: white;
    border: 2px solid #0087F7;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 135, 247, 0.1);
}

.monolox-captcha h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.captcha-question {
    font-size: 20px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.captcha-question span {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    color: #0087F7;
}

.captcha-input {
    font-size: 20px;
    width: 80px;
    text-align: center;
    padding: 8px;
    border: 2px solid #0087F7;
    border-radius: 6px;
    font-weight: 600;
}

.captcha-input:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 0.2rem rgba(0, 135, 247, 0.25);
}

/* Upload Button */
.monolox-upload-btn {
    background: #0087F7;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    margin-top: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 135, 247, 0.3);
}

.monolox-upload-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 135, 247, 0.4);
}

.monolox-upload-btn:active:not(:disabled) {
    transform: translateY(0);
}

.monolox-upload-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
}

.monolox-upload-btn .btn-text {
    position: relative;
    z-index: 1;
}

.monolox-upload-btn .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: width 0.3s;
}

/* Status Messages */
.monolox-status-message {
    margin-top: 25px;
    padding: 16px 20px;
    border-radius: 8px;
    display: none;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.monolox-status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.monolox-status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.monolox-status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.monolox-status-message .progress {
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.1);
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.monolox-status-message .progress-fill {
    height: 100%;
    background: #0087F7;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* Upload History */
.monolox-upload-history {
    margin-top: 35px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.monolox-upload-history h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.upload-history-item {
    padding: 12px 16px;
    background: white;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    border: 1px solid #e3e6ea;
}

.upload-history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.upload-history-item:last-child {
    margin-bottom: 0;
}

.upload-history-item .file-info {
    flex: 1;
}

.upload-history-item .file-info strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 4px;
}

.upload-history-item .file-info small {
    color: #6c757d;
    font-size: 12px;
}

.upload-history-item .file-status {
    font-size: 24px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .monolox-dropzone {
        padding: 40px 20px;
    }
    
    .monolox-dropzone-icon {
        font-size: 56px;
    }
    
    .monolox-dropzone-text h3 {
        font-size: 20px;
    }
    
    .monolox-dropzone-text p {
        font-size: 14px;
    }
    
    .dz-preview {
        margin: 5px;
        padding: 12px;
        min-width: 100px;
        max-width: 120px;
    }
    
    .dz-preview .file-icon {
        font-size: 36px;
    }
    
    .monolox-upload-btn {
        width: 100%;
        padding: 12px 24px;
    }
    
    .captcha-question {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .monolox-upload-form {
        padding: 20px 15px;
    }
    
    .monolox-dropzone {
        min-height: 200px;
    }
    
    .upload-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .monolox-upload-form,
    .monolox-upload-history {
        background: #1a1a1a;
        border-color: #2d2d2d;
    }
    
    .monolox-dropzone {
        background: #0d0d0d;
        border-color: #0087F7;
    }
    
    .monolox-dropzone:hover {
        background: #1a1a1a;
    }
    
    .monolox-form-group input,
    .monolox-form-group textarea {
        background: #0d0d0d;
        border-color: #2d2d2d;
        color: #e0e0e0;
    }
    
    .dz-preview {
        background: #1a1a1a;
    }
    
    .upload-history-item {
        background: #0d0d0d;
        border-color: #2d2d2d;
    }
    
    h3, h4, strong {
        color: #e0e0e0;
    }
    
    p, label, small {
        color: #b0b0b0;
    }
}