/* Media Upload Styles for Inside Talk */

.media-upload-section {
    margin: 15px 0;
    padding: 15px;
    border: 2px dashed #e0e7ff;
    border-radius: 8px;
    background: #f8faff;
    transition: all 0.3s ease;
}

.media-upload-section:hover {
    border-color: #6366f1;
    background: #f0f4ff;
}

.media-upload-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
}

.media-upload-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.media-upload-input:hover {
    border-color: #6366f1;
}

.media-upload-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.media-upload-info {
    margin-top: 8px;
}

.media-upload-info small {
    color: #6b7280;
    font-size: 12px;
}

.media-preview-container {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.media-preview-item {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.media-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.media-preview-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.media-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.media-preview-remove:hover {
    background: rgba(239, 68, 68, 1);
}

.media-preview-name {
    padding: 6px 8px;
    font-size: 11px;
    color: #6b7280;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .media-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .media-preview-image {
        height: 70px;
    }
    
    .media-upload-section {
        margin: 10px 0;
        padding: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .media-upload-section {
        background: #1f2937;
        border-color: #374151;
    }
    
    .media-upload-section:hover {
        background: #111827;
        border-color: #6366f1;
    }
    
    .media-upload-label {
        color: #f3f4f6;
    }
    
    .media-upload-input {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .media-upload-info small {
        color: #9ca3af;
    }
    
    .media-preview-item {
        background: #374151;
        border-color: #4b5563;
    }
    
    .media-preview-name {
        background: #1f2937;
        border-color: #4b5563;
        color: #9ca3af;
    }
}

/* Animation for file upload feedback */
.media-upload-section.uploading {
    border-color: #10b981;
    background: #ecfdf5;
}

.media-upload-section.error {
    border-color: #ef4444;
    background: #fef2f2;
}

/* Loading state */
.media-preview-item.loading {
    opacity: 0.7;
}

.media-preview-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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