/* UPLOAD FILES - SECTION */

#file-management-section {
    background: #fff;
    padding: 50px;
    transition: all 0.3s ease;
}

#file-management-section h3 {
    display: flex;
    align-items: center;
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #3A4F66;
}

#file-management-section h3 .dashicons {
    margin-right: 15px;
    font-size: 28px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #6498FC, #0968FE);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s ease;
}

#file-management-section .description,
.uploaded-files-section .description {
    margin-bottom: 20px;
    color: #3A4F66;
    line-height: 1.6;
    font-size: 14px;
}

.file-upload-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 2px dashed #e2e8f0;
    transition: all 0.3s ease;
}

.file-upload-container:hover {
    border-color: #6498FC;
    background: #f1f5ff;
}

#assistant_file {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#assistant_file:hover {
    border-color: #6498FC;
}

#upload_file {
    flex-shrink: 0;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6498FC, #0968FE);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

#upload_file:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(100, 152, 252, 0.2);
}

#upload_file:active {
    transform: translateY(0);
}

#file-upload-status {
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    display: none;
    animation: fadeIn 0.3s ease;
}

#file-upload-status.info {
    color: #0968fe;
    background-color: rgba(9, 104, 254, 0.1);
}

#file-upload-status.success {
    color: #03B5AA;
    background-color: rgba(3, 181, 170, 0.1);
}

#file-upload-status.error {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}


/* List Sections */
.uploaded-files-section {
    padding: 25px;
    background: #f8fafc;
    border-radius: 10px;
    margin-top: 30px;
}

.uploaded-files-section h3 {
    color: #3A4F66;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#assistant-files-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#assistant-files-list .empty-list {
    font-style: italic;
    color: #64748b;
    padding: 20px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
}

#assistant-files-list li {
    padding: 18px;
    margin-bottom: 15px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

#assistant-files-list li:hover {
    border-color: #0968fe;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

#assistant-files-list .file-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#assistant-files-list .file-name {
    font-weight: 500;
    color: #3A4F66;
    font-size: 14px;
}

#assistant-files-list .qa-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 10px;
    transition: all 0.2s ease;
}

#assistant-files-list .qa-status.active {
    background-color: rgba(3, 181, 170, 0.1);
    color: #03B5AA;
}

#assistant-files-list .qa-status.active::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #03B5AA;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(3, 181, 170, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(3, 181, 170, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(3, 181, 170, 0);
    }
}

#assistant-files-list .delete-file {
    background: none;
    border: none;
    color: #3A4F66;
    cursor: pointer;
    font-size: 24px;
    padding: 8px;
    width: 36px;
    height: 36px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#assistant-files-list .delete-file::after {
    content: '×';
}

#assistant-files-list .delete-file:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

#assistant-files-list .loading {
    font-style: italic;
    color: #0968fe;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Upload Progress */
.upload-progress-container {
    margin: 15px 0;
}

.file-progress {
    padding: 15px;
    margin-bottom: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
}

.file-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.file-progress .file-name {
    color: #3A4F66;
    font-size: 14px;
    font-weight: 500;
}

.progress-status {
    font-size: 12px;
    color: #64748b;
}

.progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #6498FC, #0968FE);
    transition: width 0.3s ease;
}

.file-progress.error {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

.file-progress.success {
    background-color: rgba(3, 181, 170, 0.1);
    border-color: #03B5AA;
}

.file-progress.error .progress-bar-fill {
    background: #dc3545;
}

.file-progress.success .progress-bar-fill {
    background: #03B5AA;
}

/* Performance information styles */
.file-performance-info {
    background: #e8f4f8;
    border: 1px solid #b3d9e6;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    color: #2c5f7d;
    font-size: 12px;
}

.file-performance-info small {
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-performance-info small::before {
    content: "⚡";
    font-size: 14px;
}

/* Cache refresh button styles */
.refresh-file-cache {
    background: #fff!important;
    border: 1px solid #fff!important;
    color: #0968fe!important;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
    line-height: 1.2;
}

.refresh-file-cache:hover {
    background: #0968fe!important;
    color: white!important;
}

.refresh-file-cache:active {
    transform: scale(0.98);
}

/* Info icon tooltip styles */
.info-icon-container {
    position: relative;
    display: inline-block;
}

.info-icon-container .dashicons-info-outline {
    color: #3A4F66!important;
    cursor: help;
    transition: color 0.3s ease;
}

.info-icon-container .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    background-color: #2c3e50;
    color: white;
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    white-space: nowrap;
    max-width: 300px;
    white-space: normal;
    width: 280px;
    z-index: 1000;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.info-icon-container .tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #2c3e50;
}

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

/* Refresh cache button and info icon container */
.refresh-cache-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    #file-management-section {
        padding: 20px;
    }

    #file-management-section h3 {
        font-size: 1.2em;
    }

    .file-upload-container {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    #assistant_file {
        width: 100%;
    }

    #upload_file {
        width: 100%;
    }

    .uploaded-files-section {
        padding: 15px;
    }
}
