/**
 * File Attachments Styles
 * Professional UI for file upload and management
 */

/* ==================== CONTAINER ==================== */

.file-attachment-container {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #3498db;
}

.file-attachment-container .property-label {
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

/* ==================== UPLOAD AREA ==================== */

.file-upload-area {
    border: 2px dashed #d1d9e0;
    border-radius: 10px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
    margin-bottom: 18px;
}

.file-upload-area:hover {
    border-color: #3498db;
    background: #f0f7ff;
    transform: translateY(-1px);
}

.file-upload-area.drag-over {
    border-color: #2ecc71;
    background: #e8f8f0;
    border-style: solid;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.15);
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.upload-text {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 6px;
    line-height: 1.5;
}

.upload-text strong {
    color: #3498db;
    font-weight: 600;
}

.upload-hint {
    font-size: 11px;
    color: #95a5a6;
    line-height: 1.6;
}

/* ==================== FILE LIST ==================== */

.file-list {
    max-height: 400px;
    overflow-y: auto;
}

.file-list-empty {
    text-align: center;
    padding: 24px;
    color: #95a5a6;
    font-size: 14px;
    font-style: italic;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

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

.file-item:hover {
    background: #f8fafb;
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.file-item:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(52, 152, 219, 0.15);
}

/* ==================== FILE PREVIEW ==================== */

.file-preview {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
}

.file-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon {
    font-size: 28px;
    opacity: 0.7;
}

.pdf-icon {
    color: #e74c3c;
    font-size: 30px;
}

/* ==================== FILE INFO ==================== */

.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.file-name {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1.3;
    word-break: break-word;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #95a5a6;
}

.file-meta-separator {
    color: #cbd5e0;
    font-weight: bold;
}

.file-size {
    font-weight: 500;
    color: #7f8c8d;
}

.file-date {
    color: #95a5a6;
}

/* ==================== FILE ACTIONS ==================== */

.file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.btn-file-action {
    width: 34px;
    height: 34px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 10;
    position: relative;
}

.btn-file-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.btn-delete {
    color: #e74c3c;
}

.btn-delete:hover {
    background: #ffebee;
    border-color: #e74c3c;
}

.btn-extract {
    color: #9b59b6;
}

.btn-extract:hover {
    background: #f3e5f5;
    border-color: #9b59b6;
}

/* ==================== DROPDOWN MENU ==================== */

.file-actions-dropdown {
    position: relative;
    flex-shrink: 0;
}

.btn-file-menu {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-file-menu:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-file-menu .menu-icon {
    font-size: 18px;
    font-weight: bold;
    color: #64748b;
    line-height: 1;
}

.file-dropdown-menu {
    position: fixed;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(-4px);
    transform-origin: top right;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    padding: 6px 0;
}

.file-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    text-align: left;
    transition: background 0.15s ease;
}

.dropdown-item:first-child {
    border-radius: 7px 7px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 7px 7px;
}

.dropdown-item:only-child {
    border-radius: 7px;
}

.dropdown-item:hover {
    background: #f8fafc;
}

.dropdown-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* Analyze item styling */
.dropdown-item.btn-analyze {
    color: #7c3aed;
}

.dropdown-item.btn-analyze:hover {
    background: #f5f3ff;
}

.dropdown-item.btn-analyze:disabled,
.dropdown-item.btn-analyze.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: none;
}

/* View Results item styling */
.dropdown-item.btn-view-results {
    color: #0891b2;
}

.dropdown-item.btn-view-results:hover {
    background: #ecfeff;
}

/* Remove item styling */
.dropdown-item.btn-remove {
    color: #64748b;
}

.dropdown-item.btn-remove:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ==================== SCROLLBAR STYLING ==================== */

.file-list::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.file-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .file-item {
        flex-wrap: wrap;
    }
    
    .file-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    
    .file-preview {
        width: 50px;
        height: 50px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .file-upload-area {
        padding: 16px;
    }
}

/* ==================== LOADING STATE ==================== */

.file-item.uploading {
    opacity: 0.6;
    pointer-events: none;
}

.file-item.uploading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

