/* 自定義樣式 */
body {
    font-family: 'Microsoft JhengHei', 'PingFang TC', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
}

/* 公告拖動樣式 */
.announcement-card, .removable-card {
    transition: all 0.3s ease;
}

/* 只有可拖動的卡片才顯示移動光標 */
.announcement-card[draggable="true"], .removable-card[draggable="true"] {
    cursor: move;
}

.announcement-card:hover, .removable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.announcement-card.dragging, .removable-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
}

.sortable-container {
    min-height: 50px;
}

.sortable-container.drag-over {
    background-color: rgba(13, 110, 253, 0.1);
    border: 2px dashed #007bff;
    border-radius: 8px;
}

.drag-handle {
    cursor: grab;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.drag-handle:hover {
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

/* 重要公告特殊樣式 */
.important-announcement {
    border-left: 4px solid #ffc107;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.important-announcement:hover {
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.3);
}

.important-announcements-section {
    position: relative;
}

.important-announcements-section::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #ffc107, #ffca2c);
    border-radius: 2px;
}

/* 拖動佔位符 */
.drag-placeholder {
    height: 100px;
    background-color: rgba(13, 110, 253, 0.1);
    border: 2px dashed #007bff;
    border-radius: 8px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007bff;
    font-weight: 500;
}

.drag-placeholder::before {
    content: '放置公告到這裡';
    font-size: 14px;
}

.navbar-brand {
    font-weight: bold;
}

.jumbotron {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 10px;
}

.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.announcement-content pre {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6;
    font-family: 'Microsoft JhengHei', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.badge {
    font-size: 0.75em;
}

.table th {
    border-top: none;
    font-weight: 600;
}

.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-group-sm > .btn, .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.alert {
    border: none;
    border-radius: 8px;
}

.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.text-decoration-none:hover {
    text-decoration: underline !important;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .jumbotron .row .col-md-4 {
        margin-bottom: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
    }
}

/* 狀態顏色 */
.bg-pending { background-color: #ffc107 !important; }
.bg-processing { background-color: #17a2b8 !important; }
.bg-resolved { background-color: #28a745 !important; }
.bg-closed { background-color: #6c757d !important; }

/* 動畫效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表格樣式優化 */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #343a40;
    color: white;
    border: none;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 統計卡片樣式 */
.card.text-center h5 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0;
}

.card.text-center small {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Markdown 內容樣式 */
.markdown-content {
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.markdown-content h1 { font-size: 2rem; }
.markdown-content h2 { font-size: 1.75rem; }
.markdown-content h3 { font-size: 1.5rem; }
.markdown-content h4 { font-size: 1.25rem; }
.markdown-content h5 { font-size: 1.1rem; }
.markdown-content h6 { font-size: 1rem; }

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.markdown-content li {
    margin-bottom: 0.25rem;
}

.markdown-content blockquote,
blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6c757d;
    font-style: italic;
    /*background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;*/
}

.markdown-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.markdown-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    text-align: left;
}

.markdown-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.markdown-content hr {
    border: none;
    border-top: 2px solid #dee2e6;
    margin: 2rem 0;
}

.markdown-content a {
    color: #007bff;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

/* Markdown 預覽樣式 */
.markdown-content-preview {
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.markdown-content-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #f8f9fa);
}

/* Markdown 工具列樣式 */
.markdown-toolbar {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.markdown-toolbar .btn {
    border-radius: 4px;
}

/* 編輯器樣式 */
.markdown-editor-container {
    position: relative;
}

.markdown-editor-container textarea,
.markdown-editor-container #markdown-preview,
.markdown-editor-container #markdown-preview-issue {
    border-radius: 6px;
    font-size: 14px;
}