/* Case Panel - Panel sprawy w edytorze dokumentu */

.case-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.case-panel-content {
    background-color: white;
    padding: 15px;
    overflow-y: auto;
    max-height: 500px; /* Ograniczona wysokość, ponieważ panel jest pod formularzem */
}

/* Wariant pełnej wysokości dla zakładki */
.case-panel-full-height {
    max-height: none !important;
    height: calc(100vh - 280px);
}

.case-panel-empty {
    background-color: white;
    padding: 30px 15px;
    text-align: center;
}

.empty-state-icon {
    margin-bottom: 15px;
}

/* Case Info Section */
.case-info-section {
    margin-bottom: 20px;
    padding: 16px;
    background-color: #fafafa;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
}

.case-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e2e2;
}

.case-info-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: #002451;
    margin: 0;
    flex: 1;
}

.case-status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.case-status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.case-status-badge.archived {
    background-color: #f8d7da;
    color: #721c24;
}

.case-info-details {
    margin-bottom: 15px;
}

.case-detail-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
}

.case-detail-row .label {
    color: #8e8e93;
    font-weight: 400;
    flex-shrink: 0;
    min-width: 120px;
}

.case-detail-row .value {
    color: #002451;
    font-weight: 500;
    text-align: left;
}

.case-description {
    margin-top: 14px;
}

.case-action-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e2e2;
}

.case-action-buttons .btn,
.case-action-buttons .main-btn {
    margin: 0;
    width: auto;
    display: inline-block;
    white-space: nowrap;
}

.case-back-section {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e2e2;
}

.case-back-section .btn,
.case-back-section .main-btn {
    width: auto;
    display: inline-block;
}

.case-section-label {
    font-size: 12px;
    font-weight: 600;
    color: #223d32;
}

.case-description-content {
    margin-top: 8px;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #54b848;
    font-size: 12px;
    color: #002451;
    line-height: 1.5;
}

/* Case Section (Collapsible) */
.case-section {
    margin-bottom: 15px;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
}

.case-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background-color: #f5f5f5;
    cursor: pointer;
    user-select: none;
}

.case-section-header:hover {
    background-color: #ebebeb;
}

.toggle-icon {
    font-size: 10px;
    color: #8e8e93;
}

/* Comments Section */
.case-comments-list {
    padding: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.case-comment-item {
    padding: 8px;
    margin-bottom: 8px;
    background-color: #f9f9f9;
    border-left: 3px solid #54b848;
    border-radius: 2px;
}

.case-comment-item .comment-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 11px;
}

.comment-actions {
    display: inline-flex;
    margin-left: auto;
    align-items: center;
}

.comment-edit-section {
    margin-top: 8px;
}

.comment-edit-section textarea {
    font-size: 12px;
}

.comment-edit-section .btn {
    font-size: 11px;
    padding: 4px 8px;
}

.case-comment-item .comment-header strong {
    color: #002451;
}

.case-comment-item .comment-date {
    color: #8e8e93;
    font-size: 10px;
}

.case-comment-item .comment-content {
    font-size: 12px;
    color: #002451;
    line-height: 1.4;
}

.view-all-comments {
    padding: 8px;
    text-align: center;
    color: #54b848;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.view-all-comments:hover {
    text-decoration: underline;
}

.add-comment-section {
    padding: 10px;
    border-top: 1px solid #e2e2e2;
}

.add-comment-section textarea {
    font-size: 12px;
}

.add-comment-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.add-comment-actions .btn,
.add-comment-actions .main-btn {
    width: auto;
    display: inline-block;
}

/* Attachments Section */
.case-attachments-list {
    padding: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.case-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 8px;
    background-color: #f9f9f9;
    border-left: 3px solid #54b848;
    border-radius: 2px;
}

.attachment-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.attachment-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    flex-shrink: 0;
}

.attachment-details {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 12px;
    font-weight: 500;
    color: #002451;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-meta {
    font-size: 10px;
    color: #8e8e93;
    margin-top: 2px;
}

.attachment-author {
    margin-right: 10px;
}

.attachment-date {
    font-style: italic;
}

.attachment-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 10px;
}

.no-attachments {
    padding: 20px;
    text-align: center;
}

.add-attachment-actions {
    display: flex;
    justify-content: flex-end;
    padding: 10px;
    border-top: 1px solid #e2e2e2;
}

.add-attachment-actions .btn,
.add-attachment-actions .main-btn {
    width: auto;
    display: inline-block;
}

/* Case selector (gdy wiele spraw) */
.case-selector {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e2e2;
}

.case-selector .case-section-label {
    display: block;
    margin-bottom: 8px;
}

.case-selector .form-control {
    font-size: 13px;
}

/* Mockup placeholder */
.mockup-section {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 4px;
    text-align: center;
}

/* Komentarze - rozróżnienie pracownik/klient */
.case-comment-item.employee-comment {
    border-left-color: #54b848;
}

.case-comment-item.client-comment {
    border-left-color: #0078d4;
    background-color: #f0f8ff;
}

.comment-role {
    color: #8e8e93;
    font-size: 10px;
    font-weight: normal;
    margin-left: 5px;
}

.no-comments {
    padding: 20px;
    text-align: center;
}

.add-comment-section textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Document link (used in Cases.razor) */
.document-link {
    color: #54b848 !important;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.document-link:hover {
    color: #459a3a !important;
    text-decoration: underline;
}

/* Scrollbar styling */
.case-panel-content::-webkit-scrollbar,
.case-comments-list::-webkit-scrollbar,
.case-attachments-list::-webkit-scrollbar {
    width: 6px;
}

.case-panel-content::-webkit-scrollbar-track,
.case-comments-list::-webkit-scrollbar-track,
.case-attachments-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.case-panel-content::-webkit-scrollbar-thumb,
.case-comments-list::-webkit-scrollbar-thumb,
.case-attachments-list::-webkit-scrollbar-thumb {
    background: #54b848;
    border-radius: 3px;
}

.case-panel-content::-webkit-scrollbar-thumb:hover,
.case-comments-list::-webkit-scrollbar-thumb:hover,
.case-attachments-list::-webkit-scrollbar-thumb:hover {
    background: #459a3a;
}
