/* File Upload Improvements */
.file-upload-wrapper {
    position: relative;
}

.carelane-file-upload {
    display: none;
}

.add-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.file-upload-list {
    margin-top: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    background: #f8f9fa;
    display: none;
}

.file-upload-list.has-files {
    display: block;
}

.file-upload-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 8px;
}

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

.file-upload-item .file-name {
    flex: 1;
    font-size: 14px;
    color: #212529;
}

.file-upload-item .remove-file {
    color: #dc3545;
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
    padding: 0 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.file-upload-item .remove-file:hover {
    color: #a71d2a;
}

/* Attachment Display */
.attachment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.attachment-thumbnail {
    display: inline-block;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.attachment-thumbnail:hover {
    border-color: #00b097;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: #212529;
    transition: all 0.2s;
    cursor: pointer;
}

.attachment-link:hover {
    background: #e9ecef;
    border-color: #00b097;
    color: #00b097;
    text-decoration: none;
}

.attachment-icon {
    width: 24px;
    height: 24px;
    color: #6c757d;
}

.attachment-link:hover .attachment-icon {
    color: #00b097;
}

/* Lightbox */
.attachment-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.attachment-lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    transition: transform 0.2s;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

.lightbox-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.lightbox-iframe {
    width: 800px;
    height: 600px;
    max-width: 100%;
    border: none;
}

.lightbox-file-info {
    text-align: center;
    padding: 40px;
}

.lightbox-file-info i {
    color: #6c757d;
    margin-bottom: 20px;
}

.lightbox-file-info p {
    font-size: 18px;
    color: #212529;
    margin: 0;
}

.lightbox-footer {
    padding: 16px 20px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: center;
}

.lightbox-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .attachment-thumbnail {
        width: 80px;
        height: 80px;
    }
    
    .lightbox-iframe {
        width: 100%;
        height: 400px;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
}
