/* Custom styles for PR Review Utility */

body {
    background-color: #f8f9fa;
}

.card {
    border: none;
    border-radius: 8px;
}

.card-header {
    border-radius: 8px 8px 0 0 !important;
}

pre {
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.4;
}

    pre code {
        color: #333;
    }

.list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

    .list-group-item:hover {
        background-color: #f8f9fa;
        border-left-color: #0d6efd;
    }

.spinner-border {
    width: 3rem;
    height: 3rem;
}

code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.navbar-brand {
    font-weight: 600;
}

.btn {
    border-radius: 4px;
}

/* Diff syntax highlighting */
pre code {
    display: block;
    white-space: pre;
    word-wrap: normal;
}

.text-success {
    font-weight: 600;
}

.text-danger {
    font-weight: 600;
}

/* URL Input Enhancements */
#prUrl.is-valid {
    border-color: #198754;
    padding-right: calc(1.5em + .75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

#prUrl.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + .75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

/* Disabled field styling */
input:disabled {
    cursor: not-allowed;
}

/* Lock icon styling */
.bi-lock-fill {
    font-size: 0.85rem;
    margin-left: 5px;
}

/* Clear button styling */
#clearUrlBtn {
    border-left: 0;
}

/* Workspace info alert */
#workspaceInfo {
    border-left: 4px solid #0d6efd;
}

/* URL Feedback alerts */
#urlFeedback.alert {
    font-size: 0.9rem;
}

#urlFeedback .bi {
    font-size: 1rem;
    margin-right: 5px;
}

/* Smooth transitions */
.form-control,
.btn,
.alert {
    transition: all 0.2s ease-in-out;
}

/* Form separator styling */
hr {
    border-top: 2px solid #dee2e6;
    opacity: 0.5;
}

/* ========================================
   FILE SELECTION ENHANCEMENTS
   ======================================== */

/* Select All checkbox styling */
#selectAllCheckbox {
    cursor: pointer;
    width: 1.2em;
    height: 1.2em;
}

    #selectAllCheckbox:indeterminate {
        background-color: #0d6efd;
        border-color: #0d6efd;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e");
    }

/* File checkboxes */
.list-group-item .form-check-input {
    cursor: pointer;
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.15em;
}

/* Selection counter badge */
#selectionCounter {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

/* Selection warning */
#selectionWarning {
    border-left: 4px solid #ffc107;
}

/* File item when unchecked - slightly greyed out */
.list-group-item:has(.form-check-input:not(:checked)) {
    opacity: 0.6;
    background-color: #f8f9fa;
}

    .list-group-item:has(.form-check-input:not(:checked)):hover {
        opacity: 0.8;
    }

/* Raw diff counter styling */
#rawDiffCounter {
    font-size: 0.85rem;
    display: block;
    margin-top: 0.25rem;
}

/* File selection controls container */
.bg-light.rounded {
    border: 1px solid #dee2e6;
}

/* Checkbox hover effect */
.form-check-input:hover {
    border-color: #0d6efd;
}

/* Checked checkbox animation */
.form-check-input:checked {
    animation: checkboxPulse 0.3s ease;
}

@keyframes checkboxPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Selection controls spacing */
.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Badge transitions */
.badge {
    transition: background-color 0.3s ease;
}

/* File item checkbox container */
.list-group-item .form-check {
    min-width: 40px;
}

/* Improved file list spacing */
.list-group-item .flex-grow-1 {
    min-width: 0;
}

/* ========================================
   REVIEW PANEL SLIDE-IN
   ======================================== */

/* Review Panel */
.review-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

    .review-panel.active {
        right: 0;
    }

.review-panel-header {
    background-color: #198754;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

    .review-panel-header h5 {
        margin: 0;
        font-size: 1.1rem;
    }

.review-panel-filters {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

    .review-panel-filters .form-check {
        margin-bottom: 0;
        padding: 0.4rem 0.8rem;
        border-radius: 6px;
        background-color: white;
        border: 1px solid #dee2e6;
        transition: all 0.2s;
    }

        .review-panel-filters .form-check:hover {
            border-color: #0d6efd;
            box-shadow: 0 2px 4px rgba(13, 110, 253, 0.1);
        }

    .review-panel-filters .form-check-input {
        cursor: pointer;
        margin-top: 0.15rem;
    }

    .review-panel-filters .form-check-label {
        cursor: pointer;
        font-size: 0.85rem;
        user-select: none;
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }

    .review-panel-filters .badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }

.review-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Review Panel Overlay */
.review-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
    transition: opacity 0.3s ease-in-out;
}

    .review-panel-overlay.active {
        display: block;
    }

/* Review Content Styles */
.review-summary {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #198754;
}

.file-review-section {
    margin-bottom: 2rem;
}

.file-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1rem;
}

    .file-review-header h6 {
        margin: 0;
        color: #495057;
    }

.violations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.violation-item {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-left-width: 4px;
    border-radius: 6px;
    padding: 1rem;
    transition: box-shadow 0.2s ease;
}

    .violation-item:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .violation-item.border-danger {
        border-left-color: #dc3545;
    }

    .violation-item.border-warning {
        border-left-color: #ffc107;
    }

    .violation-item.border-info {
        border-left-color: #17a2b8;
    }

.violation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #212529;
}

.violation-severity {
    font-size: 1.2rem;
}

.code-context {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.75rem;
    margin: 0.75rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
}

.code-line {
    display: flex;
    gap: 1rem;
    padding: 2px 0;
}

    .code-line.highlighted-line {
        background-color: #fff3cd;
        border-left: 3px solid #ffc107;
        padding-left: 0.5rem;
        margin-left: -0.5rem;
    }

.line-number {
    color: #6c757d;
    min-width: 40px;
    text-align: right;
    user-select: none;
}

.line-content {
    flex: 1;
    white-space: pre;
}

.violation-details {
    color: #495057;
    font-size: 0.9rem;
}

    .violation-details p {
        margin-bottom: 0.5rem;
    }

.violation-example {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 0.5rem 0;
}

    .violation-example code {
        background-color: transparent;
        color: #004085;
        padding: 0;
    }

.violation-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #dee2e6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .review-panel {
        width: 100%;
        right: -100%;
    }

    #selectionCounter {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .list-group-item .form-check {
        min-width: 30px;
    }

    .list-group-item .form-check-input {
        width: 1em;
        height: 1em;
    }
}

/* Keyboard focus styles for accessibility */
.form-check-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Select all container hover */
.bg-light.rounded:hover {
    background-color: #e9ecef !important;
}

/* Pretty Diff Styles */
.diff-file {
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.diff-file-header {
    background-color: #f6f8fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e1e4e8;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 600;
}

.diff-line {
    display: flex;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.diff-line-number {
    min-width: 50px;
    padding: 0 0.5rem;
    text-align: right;
    color: rgba(27, 31, 35, 0.3);
    background-color: #fafbfc;
    user-select: none;
    border-right: 1px solid #e1e4e8;
}

.diff-line-content {
    flex: 1;
    padding: 0 0.5rem;
    white-space: pre-wrap;
}

.diff-line.added {
    background-color: #e6ffec;
}

    .diff-line.added .diff-line-number {
        background-color: #cdffd8;
    }

.diff-line.removed {
    background-color: #ffebe9;
}

    .diff-line.removed .diff-line-number {
        background-color: #ffdce0;
    }

.diff-line.context {
    background-color: #fff;
}

.diff-line:hover {
    background-color: #f0f8ff;
}

.diff-hunk-header {
    background-color: #f1f8ff;
    padding: 0.25rem 0.5rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #586069;
    border-top: 1px solid #e1e4e8;
    border-bottom: 1px solid #e1e4e8;
}

/* Print styles */
@media print {
    .form-check-input,
    #selectAllCheckbox,
    .form-check,
    .review-panel,
    .review-panel-overlay {
        display: none;
    }

    .list-group-item {
        opacity: 1 !important;
    }
}
