/* ============================================
   Modern File Upload Component - Direct CSS
   ============================================ */

/* Style file inputs directly without JavaScript */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, rgba(202, 156, 94, 0.08) 0%, rgba(202, 156, 94, 0.03) 100%);
    border: 2px dashed rgba(202, 156, 94, 0.4);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 14px;
    color: #2a3539;
}

input[type="file"]:hover {
    background: linear-gradient(135deg, rgba(202, 156, 94, 0.15) 0%, rgba(202, 156, 94, 0.08) 100%);
    border-color: rgba(202, 156, 94, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(202, 156, 94, 0.2);
}

input[type="file"]:focus {
    outline: none;
    border-color: rgba(202, 156, 94, 0.8);
    box-shadow: 0 0 0 3px rgba(202, 156, 94, 0.15);
}

/* File input button styling */
input[type="file"]::file-selector-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ca9c5e 0%, #b8884a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-inline-end: 16px;
}

input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #b8884a 0%, #a67840 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(202, 156, 94, 0.3);
}

/* RTL Support - Add more spacing for Arabic */
html[dir="rtl"] input[type="file"]::file-selector-button {
    margin-inline-end: 20px;
    margin-inline-start: 0;
}

/* Additional spacing for file name text in RTL */
html[dir="rtl"] input[type="file"] {
    padding-inline-end: 20px;
}

/* Old wrapper styles for backward compatibility */
.file-upload-wrapper {
    position: relative;
    width: 100%;
}

.file-upload-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(202, 156, 94, 0.05) 0%, rgba(202, 156, 94, 0.02) 100%);
    border: 2px dashed rgba(202, 156, 94, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 120px;
    flex-direction: column;
}

.file-upload-label:hover {
    background: linear-gradient(135deg, rgba(202, 156, 94, 0.1) 0%, rgba(202, 156, 94, 0.05) 100%);
    border-color: rgba(202, 156, 94, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(202, 156, 94, 0.15);
}

.file-upload-input:focus + .file-upload-label {
    outline: 2px solid rgba(202, 156, 94, 0.5);
    outline-offset: 2px;
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ca9c5e 0%, #b8884a 100%);
    border-radius: 12px;
    color: white;
    transition: transform 0.3s ease;
}

.file-upload-label:hover .file-upload-icon {
    transform: scale(1.1) rotate(5deg);
}

.file-upload-icon svg {
    width: 24px;
    height: 24px;
}

.file-upload-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.file-upload-title {
    font-size: 15px;
    font-weight: 600;
    color: #2a3539;
}

.file-upload-subtitle {
    font-size: 13px;
    color: #6b7c85;
}

.file-upload-formats {
    font-size: 11px;
    color: #8a9ba3;
    margin-top: 4px;
}

/* File Preview */
.file-upload-preview {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background: white;
    border: 1px solid rgba(202, 156, 94, 0.2);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

.file-upload-preview.active {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.file-preview-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(202, 156, 94, 0.1) 0%, rgba(202, 156, 94, 0.05) 100%);
    border-radius: 8px;
    color: #ca9c5e;
    flex-shrink: 0;
}

.file-preview-icon svg {
    width: 20px;
    height: 20px;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
}

.file-preview-name {
    font-size: 14px;
    font-weight: 600;
    color: #2a3539;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview-size {
    font-size: 12px;
    color: #6b7c85;
    margin-top: 2px;
}

.file-preview-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: 8px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-preview-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

.file-preview-remove svg {
    width: 16px;
    height: 16px;
}

/* Error State */
.file-upload-wrapper.has-error .file-upload-label {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.05);
}

.file-upload-error {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    color: #ef4444;
    font-size: 13px;
    animation: slideDown 0.3s ease;
}

.file-upload-wrapper.has-error .file-upload-error {
    display: block;
}

/* Success State */
.file-upload-wrapper.has-file .file-upload-label {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.05);
}

/* RTL Support */
html[dir="rtl"] .file-upload-label {
    direction: rtl;
}

/* Responsive */
@media (max-width: 640px) {
    .file-upload-label {
        min-height: 100px;
        padding: 16px;
    }

    .file-upload-icon {
        width: 40px;
        height: 40px;
    }

    .file-upload-icon svg {
        width: 20px;
        height: 20px;
    }

    .file-upload-title {
        font-size: 14px;
    }

    .file-upload-subtitle {
        font-size: 12px;
    }
}

/* Admin Panel Specific Styles */
.admin-content .file-upload-label {
    background: linear-gradient(135deg, rgba(202, 156, 94, 0.08) 0%, rgba(202, 156, 94, 0.03) 100%);
}

.admin-content .file-upload-label:hover {
    background: linear-gradient(135deg, rgba(202, 156, 94, 0.15) 0%, rgba(202, 156, 94, 0.08) 100%);
}
