/* CF7 Custom File Upload Styles */

/* File Upload Section - Main Container */
.file-upload-section {
    padding: 1rem;
    border: 1px dashed #d1d5db;
    border-radius: 0.375rem;
    background-color: #fff;
}

/* File Header with Label and Tooltip */
.file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.file-label-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* Info Tooltip Button */
.info-tooltip {
    position: relative;
    width: 1rem;
    height: 1rem;
    border: 1px solid #9ca3af;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #6b7280;
    cursor: help;
    background: transparent;
    padding: 0;
    line-height: 1.3;
    transition: background-color 0.2s;
}

.info-tooltip:hover {
    background-color: #f3f4f6;
}

/* Tooltip Text */
.tooltip-text {
    position: absolute;
    right: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    width: 16rem;
    padding: 0.5rem;
    background-color: #1f2937;
    color: #fff;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    z-index: 50;
    pointer-events: none;
    white-space: normal;
}

/* Tooltip Arrow */
.tooltip-text::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #1f2937;
}

.info-tooltip:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

/* Drop Zone */
.file-drop-zone {
    position: relative;
    margin: 0.5rem 0;
}

.drop-zone-content {
    padding: 1rem;
    text-align: center;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    background-color: transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.drop-zone-content:hover,
.file-drop-zone.dragging .drop-zone-content {
    border-color: rgb(163, 163, 163);
    background-color: #f9fafb;
}

.drop-text {
    color: #4b5563;
    font-size: 0.875rem;
    margin: 0 0 0.25rem 0;
}

.drop-note {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

/* Uploaded Files Section */
.uploaded-files-list {
    margin-top: 1rem;
}

.uploaded-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin: 0 0 0.75rem 0;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .files-grid {
        grid-template-columns: 1fr;
    }
}

/* Individual File Item */
.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #fff;
    position: relative;
}

.file-preview {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 0.375rem;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-right: 0.75rem;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.375rem;
}

.file-preview svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #6b7280;
}

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

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    margin: 0 0 0.25rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0 0 0.25rem 0;
}

/* Progress Bar */
.file-progress {
    width: 100%;
    height: 0.25rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.file-progress-bar {
    height: 100%;
    background-color: #10b981;
    transition: width 0.3s ease;
    border-radius: 9999px;
}

/* Remove Button */
.file-remove {
    flex-shrink: 0;
    padding: 0.25rem;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-remove:hover {
    background-color: #f3f4f6;
    color: #ef4444;
}

.file-remove svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Error State */
.file-item.error {
    border-color: #fca5a5;
    background-color: #fee2e2;
}

.file-item.error .file-name {
    color: #991b1b;
}

/* Loading State */
.file-item.uploading {
    opacity: 0.7;
}

/* Validation Error */
.wpcf7-not-valid-tip {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

/* Drag Over State */
.file-drop-zone.drag-over .drop-zone-content {
    border-color: rgb(163, 163, 163);
    background-color: #eff6ff;
}