/**
 * File Attachment Field Plugin - CSS Styles
 */

/* Main container */
.file-attachment-field {
    position: relative;
    min-height: 40px;
}

/* Message shown during new resource upload */
.file-attachment-message {
    color: #666;
    font-style: italic;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.file-attachment-info-icon {
    font-size: 18px;
    color: #999;
}

/* Current file display */
.file-attachment-current {
    margin-bottom: 10px;
}

.file-attachment-file-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e8f4f8;
    border: 1px solid #b8d4e3;
    border-radius: 4px;
    margin-bottom: 8px;
}

.file-attachment-icon {
    font-size: 20px;
}

.file-attachment-filename {
    font-weight: 500;
    color: #333;
}

.file-attachment-size {
    color: #666;
    font-size: 0.9em;
}

.file-attachment-no-file {
    color: #999;
    font-style: italic;
    padding: 8px 0;
}

/* Action buttons */
.file-attachment-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.file-attachment-btn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
}

.file-attachment-btn:hover {
    background: #e5e5e5;
    border-color: #999;
}

.file-attachment-btn-download {
    background: #4a90d9;
    border-color: #3a7bc8;
    color: #fff;
}

.file-attachment-btn-download:hover {
    background: #3a7bc8;
    color: #fff;
}

.file-attachment-btn-delete {
    background: #dc3545;
    border-color: #c82333;
    color: #fff;
}

.file-attachment-btn-delete:hover {
    background: #c82333;
}

.file-attachment-btn-upload {
    background: #28a745;
    border-color: #1e7e34;
    color: #fff;
}

.file-attachment-btn-upload:hover {
    background: #1e7e34;
}

/* Upload form */
.file-attachment-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-attachment-upload form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-attachment-file-input {
    max-width: 300px;
}

/* Status messages */
.file-attachment-status {
    font-size: 0.9em;
    padding: 4px 8px;
    border-radius: 3px;
}

.file-attachment-status.file-attachment-success {
    color: #155724;
    background: #d4edda;
}

.file-attachment-status.file-attachment-error {
    color: #721c24;
    background: #f8d7da;
}

/* Loading overlay */
.file-attachment-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.file-attachment-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: file-attachment-spin 1s linear infinite;
}

@keyframes file-attachment-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .file-attachment-file-info {
        flex-wrap: wrap;
    }

    .file-attachment-actions {
        flex-wrap: wrap;
    }

    .file-attachment-upload form {
        flex-direction: column;
        align-items: flex-start;
    }
}
