/**
 * Bug Reporter Modal - Modern UI Styles
 */

/* Modal Improvements */
#bugReportModal .modal-content {
    border-radius: 12px;
}

#bugReportModal .modal-header {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
}

#bugReportModal .modal-body {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}

#bugReportModal .modal-footer {
    padding: 1rem 1.5rem;
}

/* Avatar for icon */
#bugReportModal .avatar-sm {
    width: 3rem;
    height: 3rem;
}

#bugReportModal .avatar-title {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#bugReportModal .bg-soft-primary {
    background-color: rgba(64, 81, 137, 0.1) !important;
}

/* Alert Styles */
#bugReportModal .alert-soft-primary {
    background-color: rgba(64, 81, 137, 0.08);
    color: #405189;
}

/* Form Controls */
#bugReportModal .form-control:focus {
    border-color: #405189;
    box-shadow: 0 0 0 0.2rem rgba(64, 81, 137, 0.15);
}

#bugReportModal .form-control-lg {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

/* Priority Selector */
.priority-selector .btn-check:checked + .btn-outline-secondary {
    background-color: #405189;
    border-color: #405189;
    color: #fff;
}

.priority-selector .btn-check:checked + .btn-outline-secondary i {
    color: #fff !important;
}

.priority-selector .btn-outline-secondary {
    border: 2px solid #e9ecef;
    padding: 0.75rem;
    transition: all 0.2s ease;
    background-color: #fff;
}

.priority-selector .btn-outline-secondary:hover {
    border-color: #405189;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 81, 137, 0.15);
}

.priority-selector .btn-outline-secondary small {
    font-size: 0.7rem;
}

/* Screenshot Preview */
#screenshotPreview {
    border: 2px dashed #e9ecef;
    transition: all 0.3s ease;
}

#screenshotPreview:hover {
    border-color: #405189;
}

#screenshotImage {
    max-height: 300px;
    object-fit: contain;
}

/* Buttons */
#bugReportModal .btn {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

#bugReportModal .btn-primary {
    background-color: #405189;
    border-color: #405189;
}

#bugReportModal .btn-primary:hover {
    background-color: #2d3a5f;
    border-color: #2d3a5f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 81, 137, 0.3);
}

#bugReportModal .btn-light {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

#bugReportModal .btn-light:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Labels */
#bugReportModal .form-label {
    margin-bottom: 0.5rem;
    color: #495057;
}

#bugReportModal .form-text {
    color: #6c757d;
    font-size: 0.8125rem;
}

/* Textarea improvements */
#bugReportModal textarea.form-control {
    font-family: inherit;
    line-height: 1.6;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#bugReportModal.show .modal-content {
    animation: slideIn 0.3s ease-out;
}

/* Alert animations */
#bugReportModal .alert {
    animation: fadeInSlide 0.3s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    #bugReportModal .modal-dialog {
        margin: 0.5rem;
    }

    #bugReportModal .modal-header,
    #bugReportModal .modal-body,
    #bugReportModal .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .priority-selector .btn-outline-secondary {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .priority-selector .btn-outline-secondary small {
        display: none;
    }

    #bugReportModal .avatar-sm {
        width: 2.5rem;
        height: 2.5rem;
    }

    #bugReportModal .avatar-title {
        font-size: 1.25rem;
    }
}

/* Loading state for submit button */
#submitBugReport.loading {
    position: relative;
    pointer-events: none;
}

#submitBugReport.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* Focus states for accessibility */
#bugReportModal .btn:focus,
#bugReportModal .form-control:focus,
#bugReportModal .btn-check:focus + .btn-outline-secondary {
    outline: 2px solid #405189;
    outline-offset: 2px;
}

/* Success state */
#bugReportModal .alert-success {
    background-color: #d1f2eb;
    border-color: #0f9d6f;
    color: #0a6f50;
}

/* Error state */
#bugReportModal .alert-danger {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* File Upload Styles */
#bugReportModal .file-upload-wrapper {
    position: relative;
}

#bugReportModal .file-item {
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

#bugReportModal .file-item:hover {
    background-color: #e9ecef;
    transform: translateX(4px);
}

#bugReportModal .file-item .btn-ghost-danger {
    opacity: 0;
    transition: opacity 0.2s ease;
}

#bugReportModal .file-item:hover .btn-ghost-danger {
    opacity: 1;
}

#bugReportModal .selected-files {
    max-height: 200px;
    overflow-y: auto;
}

#bugReportModal .selected-files::-webkit-scrollbar {
    width: 6px;
}

#bugReportModal .selected-files::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#bugReportModal .selected-files::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#bugReportModal .selected-files::-webkit-scrollbar-thumb:hover {
    background: #555;
}
