/* Custom styles for Bug Reporting System */

/* Improved card shadows */
.card {
    transition: box-shadow 0.3s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Status badge improvements */
.status-badge {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-OPEN {
    background-color: #28a745 !important;
    color: white !important;
}

.status-TODO {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.status-DOING {
    background-color: #0d6efd !important;
    color: white !important;
}

.status-DONE {
    background-color: #198754 !important;
    color: white !important;
}

.status-CLOSED {
    background-color: #6c757d !important;
    color: white !important;
}

/* Priority badge styles */
.priority-badge {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Priority color scheme for numbers 1-10 (1 = highest priority) */
.priority-1, .priority-2 {
    background-color: #dc3545 !important;
    color: white !important;
}

.priority-3, .priority-4 {
    background-color: #fd7e14 !important;
    color: white !important;
}

.priority-5, .priority-6 {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.priority-7, .priority-8 {
    background-color: #20c997 !important;
    color: white !important;
}

.priority-9, .priority-10 {
    background-color: #28a745 !important;
    color: white !important;
}

/* Code block styling */
pre {
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

pre code {
    font-family: 'Courier New', Courier, monospace;
}

/* Markdown content styling */
.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:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child,
.markdown-content h4:first-child,
.markdown-content h5:first-child,
.markdown-content h6:first-child {
    margin-top: 0;
}

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

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

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

.markdown-content blockquote {
    border-left: 4px solid #0d6efd;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #6c757d;
}

.markdown-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
}

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

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

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

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

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

.markdown-content a {
    color: #0d6efd;
    text-decoration: none;
}

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

/* RTL text support */
.markdown-content[style*="direction: rtl"] {
    text-align: right;
}

.markdown-content[style*="direction: rtl"] ul,
.markdown-content[style*="direction: rtl"] ol {
    padding-right: 2rem;
    padding-left: 0;
}

.markdown-content[style*="direction: rtl"] blockquote {
    border-right: 4px solid #0d6efd;
    border-left: none;
    padding-right: 1rem;
    padding-left: 0;
}

/* Mixed LTR/RTL content support */
.markdown-content[style*="direction: auto"] {
    direction: auto;
    text-align: start;
    unicode-bidi: plaintext;
}

.markdown-content[style*="unicode-bidi: plaintext"] {
    unicode-bidi: plaintext;
}

/* Bidirectional text support for mixed content */
.markdown-content[style*="direction: auto"] p,
.markdown-content[style*="direction: auto"] div,
.markdown-content[style*="direction: auto"] span {
    unicode-bidi: plaintext;
}

/* Support for inline RTL within LTR text and vice versa */
.markdown-content[style*="direction: auto"] .rtl-inline {
    direction: rtl;
    unicode-bidi: embed;
}

.markdown-content[style*="direction: auto"] .ltr-inline {
    direction: ltr;
    unicode-bidi: embed;
}

/* Markdown Editor Styles */
.markdown-editor {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
}

.markdown-preview {
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
}

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

.markdown-preview h1:first-child,
.markdown-preview h2:first-child,
.markdown-preview h3:first-child,
.markdown-preview h4:first-child,
.markdown-preview h5:first-child,
.markdown-preview h6:first-child {
    margin-top: 0;
}

.markdown-preview p {
    margin-bottom: 0.75rem;
}

.markdown-preview ul,
.markdown-preview ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

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

.markdown-preview blockquote {
    border-left: 3px solid #0d6efd;
    padding-left: 0.75rem;
    margin: 0.75rem 0;
    font-style: italic;
    color: #6c757d;
}

.markdown-preview code {
    background-color: #f8f9fa;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
}

.markdown-preview pre {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin: 0.75rem 0;
    border: 1px solid #e9ecef;
}

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

.markdown-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

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

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

.markdown-preview a {
    color: #0d6efd;
    text-decoration: none;
}

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

/* Editor toolbar styles */
.btn-group .btn {
    transition: all 0.2s ease-in-out;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
}

.btn-group .btn:active {
    transform: translateY(0);
}

/* File attachment styles */
.attachment-card {
    transition: transform 0.2s ease-in-out;
}

.attachment-card:hover {
    transform: translateY(-2px);
}

.attachment-icon {
    font-size: 1.5rem;
}

/* Form improvements */
.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Table improvements */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Button improvements */
.btn {
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Navigation improvements */
.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    form {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    pre {
        border: 1px solid #ccc !important;
        background-color: #f8f9fa !important;
        color: #000 !important;
    }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .markdown-editor {
        font-size: 0.85rem;
    }
    
    .markdown-preview {
        font-size: 0.85rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
} 

/* Professional EasyMDE Custom Styles */
 

/* Professional CKEditor Custom Styles */
.ckeditor-container {
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-height: 300px;
}

.ckeditor-container:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

/* CKEditor Main Container */
.ck.ck-editor__main {
    background-color: #ffffff;
    min-height: 250px;
}

.ck.ck-editor__main > .ck-editor__editable {
    background-color: #ffffff;
    border: none;
    padding: 1rem;
    min-height: 250px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #212529;
}

/* CKEditor Toolbar */
.ck.ck-toolbar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #e9ecef;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 8px 12px;
}

.ck.ck-toolbar__items {
    gap: 4px;
}

.ck.ck-toolbar .ck-button {
    color: #495057;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    padding: 6px 8px;
    margin: 0 2px;
    transition: all 0.2s ease-in-out;
    font-size: 0.9rem;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ck.ck-toolbar .ck-button:hover {
    color: #0d6efd;
    background-color: #e7f3ff;
    border-color: #b3d9ff;
    transform: translateY(-1px);
}

.ck.ck-toolbar .ck-button.ck-on {
    color: #0d6efd;
    background-color: #e7f3ff;
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

.ck.ck-toolbar .ck-button.ck-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* CKEditor Dropdowns */
.ck.ck-dropdown .ck-button.ck-dropdown__button {
    padding-right: 1.5rem;
}

.ck.ck-dropdown .ck-button.ck-dropdown__button::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 0.5rem;
}

.ck.ck-dropdown__panel {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: #ffffff;
}

.ck.ck-dropdown__panel .ck-list__item {
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease;
}

.ck.ck-dropdown__panel .ck-list__item:hover {
    background-color: #e7f3ff;
}

.ck.ck-dropdown__panel .ck-list__item.ck-on {
    background-color: #0d6efd;
    color: #ffffff;
}

/* CKEditor Content Styling */
.ck.ck-editor__editable h1,
.ck.ck-editor__editable h2,
.ck.ck-editor__editable h3,
.ck.ck-editor__editable h4,
.ck.ck-editor__editable h5,
.ck.ck-editor__editable h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.ck.ck-editor__editable h1:first-child,
.ck.ck-editor__editable h2:first-child,
.ck.ck-editor__editable h3:first-child,
.ck.ck-editor__editable h4:first-child,
.ck.ck-editor__editable h5:first-child,
.ck.ck-editor__editable h6:first-child {
    margin-top: 0;
}

.ck.ck-editor__editable h1 {
    font-size: 2rem;
    border-bottom: 3px solid #0d6efd;
    padding-bottom: 0.5rem;
}

.ck.ck-editor__editable h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.25rem;
}

.ck.ck-editor__editable h3 {
    font-size: 1.5rem;
}

.ck.ck-editor__editable p {
    margin-bottom: 1rem;
    text-align: inherit;
}

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

.ck.ck-editor__editable li {
    margin-bottom: 0.5rem;
    text-align: inherit;
}

.ck.ck-editor__editable blockquote {
    border-left: 4px solid #0d6efd;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #495057;
    background-color: #f8f9fa;
    border-radius: 0 0.375rem 0.375rem 0;
}

.ck.ck-editor__editable code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.85em;
    color: #e83e8c;
    border: 1px solid #e9ecef;
}

.ck.ck-editor__editable pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #e9ecef;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ck.ck-editor__editable pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    color: #495057;
}

.ck.ck-editor__editable table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.ck.ck-editor__editable th,
.ck.ck-editor__editable td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    text-align: inherit;
}

.ck.ck-editor__editable th {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    font-weight: 600;
    text-align: center;
}

.ck.ck-editor__editable tr:nth-child(even) {
    background-color: #f8f9fa;
}

.ck.ck-editor__editable tr:hover {
    background-color: #e7f3ff;
}

.ck.ck-editor__editable a {
    color: #0d6efd;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.ck.ck-editor__editable a:hover {
    color: #0b5ed7;
    border-bottom-color: #0d6efd;
}

/* RTL Support for CKEditor */
.ckeditor-container[data-direction="rtl"] .ck.ck-editor__main > .ck-editor__editable {
    direction: rtl;
    text-align: right;
    font-family: 'Tahoma', 'Arial', sans-serif;
}

.ckeditor-container[data-direction="rtl"] .ck.ck-editor__editable ul,
.ckeditor-container[data-direction="rtl"] .ck.ck-editor__editable ol {
    padding-right: 2rem;
    padding-left: 0;
}

.ckeditor-container[data-direction="rtl"] .ck.ck-editor__editable blockquote {
    border-right: 4px solid #0d6efd;
    border-left: none;
    padding: 1rem 1.5rem;
    border-radius: 0.375rem 0 0 0.375rem;
}

/* Auto Direction Support */
.ckeditor-container[data-direction="auto"] .ck.ck-editor__main > .ck-editor__editable {
    direction: auto;
    text-align: start;
    unicode-bidi: plaintext;
}

/* Focus States */
.ckeditor-container:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Invalid States */
.ckeditor-container.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.ckeditor-container.is-invalid:focus-within {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.ck.ck-editor__editable:focus {
    outline: none;
    box-shadow: none;
}

/* Loading States */
.ckeditor-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ckeditor-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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



/* Per-Line Direction Display Styles */
.per-line-direction p[dir="rtl"] {
    direction: rtl;
    text-align: right;
    unicode-bidi: embed;
}

.per-line-direction p[dir="ltr"] {
    direction: ltr;
    text-align: left;
    unicode-bidi: embed;
}

.per-line-direction li[dir="rtl"] {
    direction: rtl;
    text-align: right;
    unicode-bidi: embed;
}

.per-line-direction li[dir="ltr"] {
    direction: ltr;
    text-align: left;
    unicode-bidi: embed;
}

.per-line-direction div[dir="rtl"] {
    direction: rtl;
    text-align: right;
    unicode-bidi: embed;
}

.per-line-direction div[dir="ltr"] {
    direction: ltr;
    text-align: left;
    unicode-bidi: embed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ck.ck-toolbar {
        padding: 6px 8px;
    }
    
    .ck.ck-toolbar .ck-button {
        padding: 4px 6px;
        margin: 0 1px;
        min-width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .ck.ck-editor__main > .ck-editor__editable {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    .ckeditor-container {
        min-height: 250px;
    }
} 