/**
 * Documents Management Styles
 * Styles für die zentrale Dokumentenverwaltung
 */

/* Document List */
.documents-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px 0;
    max-height: 60vh;
    overflow-y: auto;
}

.documents-toolbar {
    padding: 10px 0;
    border-bottom: 1px solid #334155;
    margin-bottom: 10px;
}

.documents-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.documents-search-row .search-input {
    flex: 1;
    min-width: 200px;
}

.documents-search-row .form-select {
    min-width: 150px;
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}

/* Document Category */
.document-category {
    margin-bottom: 20px;
}

.category-header {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-header i {
    color: #f59e0b;
}

.document-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Document Item */
.document-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    transition: all 0.2s;
}

.document-item:hover {
    background: #253449;
    border-color: #475569;
}

.document-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    border-radius: 8px;
    flex-shrink: 0;
}

.document-icon i {
    font-size: 18px;
    color: #60a5fa;
}

/* File type specific icons */
.document-icon i.fa-file-pdf { color: #ef4444; }
.document-icon i.fa-file-word { color: #3b82f6; }
.document-icon i.fa-file-excel { color: #10b981; }
.document-icon i.fa-file-powerpoint { color: #f59e0b; }
.document-icon i.fa-file-image { color: #8b5cf6; }

.document-info {
    flex: 1;
    min-width: 0;
}

.document-title {
    font-weight: 500;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.document-description {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.document-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.document-tags {
    color: #8b5cf6 !important;
}

.document-dashboards {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.dashboard-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #3b82f6;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}

.document-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.document-actions .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.document-actions .btn-icon:hover {
    background: #334155;
    color: #f1f5f9;
}

.document-actions .btn-icon.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

/* Upload Form Styles */
.document-form {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 0;
}

.document-form .form-row {
    display: flex;
    gap: 20px;
}

.document-form .form-row .form-group {
    flex: 1;
}

.document-form .form-row .form-group.flex-2 {
    flex: 2;
}

.document-form .form-group {
    margin-bottom: 20px;
}

.document-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.document-form input[type="text"],
.document-form input[type="url"],
.document-form textarea,
.document-form select {
    width: 100%;
    padding: 10px 12px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 14px;
    transition: border-color 0.2s;
}

.document-form input:focus,
.document-form textarea:focus,
.document-form select:focus {
    outline: none;
    border-color: #3b82f6;
}

.document-form textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 12px;
    color: #64748b;
    margin: 4px 0 10px;
}

/* Upload Toggle */
.upload-toggle {
    display: flex;
    gap: 20px;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #94a3b8;
}

.toggle-option input {
    accent-color: #3b82f6;
}

.toggle-option input:checked + span {
    color: #f1f5f9;
}

/* Upload Area */
#doc-upload-area {
    border: 2px dashed #334155;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: #0f172a;
    transition: all 0.2s;
    cursor: pointer;
}

#doc-upload-area:hover,
#doc-upload-area.dragover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

#doc-upload-area .upload-icon {
    font-size: 36px;
    color: #3b82f6;
    margin-bottom: 10px;
}

#doc-upload-area p {
    color: #94a3b8;
    margin: 5px 0;
}

#doc-upload-area .upload-hint {
    font-size: 12px;
    color: #64748b;
}

/* File Preview */
.file-preview {
    margin-top: 15px;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
}

.selected-file i {
    font-size: 20px;
    color: #60a5fa;
}

.selected-file span {
    color: #f1f5f9;
}

.selected-file .file-size {
    color: #64748b;
    font-size: 13px;
}

.selected-file .badge {
    margin-left: auto;
    padding: 2px 8px;
    background: #10b981;
    color: white;
    font-size: 11px;
    border-radius: 4px;
}

.selected-file.existing .badge {
    background: #8b5cf6;
}

.selected-file .btn-icon {
    margin-left: auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 4px;
}

.selected-file .btn-icon:hover {
    background: #ef4444;
    color: white;
}

/* Dashboard Assignment Grid */
.dashboard-assignment-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: #94a3b8;
}

.checkbox-label:hover {
    background: #253449;
    border-color: #475569;
}

.checkbox-label input {
    accent-color: #3b82f6;
}

.checkbox-label input:checked + span,
.checkbox-label:has(input:checked) {
    color: #f1f5f9;
}

.checkbox-label:has(input:checked) {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #334155;
    margin-top: 20px;
}

/* Empty State */
.documents-list .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.documents-list .empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.documents-list .empty-state p {
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .documents-search-row {
        flex-direction: column;
    }

    .documents-search-row .search-input,
    .documents-search-row .form-select {
        width: 100%;
    }

    .dashboard-assignment-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .document-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .document-item {
        flex-wrap: wrap;
    }

    .document-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #334155;
    }
}
