/* タスクコメント機能専用スタイル */

/* コメントセクション全体 */
.comments-section {
    margin-top: 0px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0px 5px rgba(0,0,0,0.1);
}

/* コメントヘッダー */
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.comments-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    flex: 1;
}

/* コメント投稿フォーム */
.comment-form-container {
    margin-top: 20px;
    margin-bottom: 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-input-group {
    width: 100%;
}

.comment-textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out;
}

.comment-textarea:focus {
    border-color: #007bff;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

/* コメントオプション */
.comment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.comment-option-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.comment-option-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 3px;
}

.comment-select,
.comment-input,
.comment-file {
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
}

.comment-file[type="file"] {
    width: auto;
}

.comment-select:focus,
.comment-input:focus,
.comment-file:focus {
    border-color: #007bff;
    outline: 0;
}

/* フォームアクション */
.comment-form-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 0px;
}

/* コメント一覧 */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.no-comments {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-comments i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-comments p {
    font-size: 18px;
    margin: 0;
}

/* 個別コメント */
.comment-item {
    padding: 20px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    color: #333;
}

.author-name {
    font-size: 14px;
}

.comment-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.updated-badge {
    background: #ffc107;
    color: #212529;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

.comment-body {
    margin-bottom: 12px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* メンション */
.mention {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/* 変更内容表示 */
.comment-changes {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
}

.comment-changes i {
    color: #28a745;
}

.changes-text {
    color: #155724;
    font-weight: 500;
}

/* ファイル添付 */
.comment-files {
    margin-top: 10px;
}

.comment-file {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 13px;
}

.comment-file i {
    color: #6c757d;
}

.comment-file a {
    color: #007bff;
    text-decoration: none;
}

.comment-file a:hover {
    text-decoration: underline;
}

/* コメントアクション */
.comment-actions {
    display: flex;
    gap: 15px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.btn-link {
    background: none;
    border: none;
    color: #007bff;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background-color 0.15s ease;
}

.btn-link:hover {
    background: #f8f9fa;
    text-decoration: none;
}

.btn-link i {
    margin-right: 3px;
}

/* モーダル関連 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.modal-dialog {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.15s ease;
}

.modal-close:hover {
    background: #f8f9fa;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

/* レスポンシブ対応 */
@media (max-width: 992px) {
    .comments-section {
        margin-top: 20px;
        padding: 15px;
    }
    
    .comment-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .comment-form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .comment-form-actions .btn {
        width: 100%;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .modal-dialog {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-item {
    animation: fadeIn 0.3s ease-out;
}

/* フォーカス時のアクセシビリティ改善 */
.btn-link:focus,
.modal-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ローディング状態 */
.comment-form .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.comment-form .btn:disabled i.fa-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}