/* ============================================
   TICKET MANAGEMENT SYSTEM STYLES
   ============================================ */

/* Modal Overlay */
.ticket-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ticket-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Modal Container */
.ticket-modal {
    background: #ffffff;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.ticket-modal-overlay.active .ticket-modal {
    transform: scale(1);
}

/* Modal Header */
.ticket-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.ticket-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.ticket-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
}

.ticket-modal-close:hover {
    color: #111827;
}

/* Modal Body */
.ticket-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

/* Modal Footer */
.ticket-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Ticket Detail View */
.ticket-detail-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.ticket-main-content {
    min-width: 0;
}

.ticket-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Ticket Header */
.ticket-header {
    margin-bottom: 30px;
}

.ticket-id {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 10px;
}

.ticket-title-display {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.ticket-meta-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Status Badge */
.ticket-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ticket-status.open {
    background-color: #dbeafe;
    color: #1e40af;
}

.ticket-status.in-progress {
    background-color: #fef3c7;
    color: #92400e;
}

.ticket-status.in-review {
    background-color: #e0e7ff;
    color: #3730a3;
}

.ticket-status.blocked {
    background-color: #fee2e2;
    color: #991b1b;
}

.ticket-status.closed {
    background-color: #d1fae5;
    color: #065f46;
}

/* Priority Badge */
.ticket-priority {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.ticket-priority.critical {
    background-color: #fee2e2;
    color: #991b1b;
}

.ticket-priority.high {
    background-color: #fed7aa;
    color: #9a3412;
}

.ticket-priority.medium {
    background-color: #fef3c7;
    color: #92400e;
}

.ticket-priority.low {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Ticket Description */
.ticket-section {
    margin-bottom: 30px;
}

.ticket-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 15px 0;
}

.ticket-description {
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Quality Gates Panel */
.quality-gates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.quality-gates-header .ticket-section-title {
    margin: 0;
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s, transform 0.2s;
    font-size: 1.25rem;
}

.btn-icon:hover {
    color: #111827;
    transform: rotate(180deg);
}

.refresh-icon {
    display: inline-block;
}

.quality-gates-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.quality-gates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Gate Card */
.gate-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
}

.gate-card.passed {
    border-color: #22c55e;
    background: #f0fdf4;
}

.gate-card.failed {
    border-color: #ef4444;
    background: #fef2f2;
    animation: shake 0.5s ease;
}

.gate-card.running {
    border-color: #eab308;
    background: #fefce8;
    animation: pulse 2s ease-in-out infinite;
}

.gate-card.pending {
    border-color: #6b7280;
    background: #f9fafb;
}

.gate-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Gate Header */
.gate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.gate-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gate-icon {
    font-size: 1.5rem;
    display: inline-block;
}

.gate-icon.spinning {
    animation: spin 2s linear infinite;
}

.gate-name {
    font-weight: 600;
    color: #111827;
    font-size: 1rem;
}

.gate-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.score-running {
    font-size: 0.875rem;
    color: #eab308;
    font-weight: 600;
}

/* Gate Details */
.gate-details {
    margin-top: 12px;
}

/* Findings List */
.gate-findings {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.gate-finding {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: #f9fafb;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    position: relative;
}

.gate-finding:hover {
    background: #f3f4f6;
}

.gate-finding.error {
    background: #fef2f2;
    color: #991b1b;
}

.gate-finding.warning {
    background: #fefce8;
    color: #854d0e;
}

.gate-finding.info {
    background: #eff6ff;
    color: #1e40af;
}

.gate-finding.success {
    background: #f0fdf4;
    color: #065f46;
}

.gate-finding.hidden-finding {
    display: none;
}

.gate-findings.expanded .hidden-finding {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.finding-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.finding-text {
    flex: 1;
    line-height: 1.5;
}

.btn-copy-finding {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.875rem;
}

.gate-finding:hover .btn-copy-finding {
    opacity: 1;
}

.btn-copy-finding:hover {
    transform: scale(1.1);
}

.copy-icon {
    display: inline-block;
}

/* Expand/Collapse Findings Button */
.btn-expand-findings {
    background: none;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.btn-expand-findings:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-expand-findings .collapse-text {
    display: none;
}

.gate-findings.expanded ~ .btn-expand-findings .expand-text {
    display: none;
}

.gate-findings.expanded ~ .btn-expand-findings .collapse-text {
    display: inline;
}

/* Gate Messages */
.gate-running-text {
    color: #eab308;
    font-size: 0.875rem;
    font-style: italic;
    margin: 0 0 12px 0;
}

.gate-success-text {
    color: #22c55e;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

/* Gate Actions */
.gate-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-retry,
.btn-view-details {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-retry {
    background: #ef4444;
    color: #ffffff;
    border: none;
}

.btn-retry:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-retry:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-view-details {
    background: #ffffff;
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.btn-view-details:hover {
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Gate Summary */
.gate-summary {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.gate-summary p {
    margin: 0 0 8px 0;
    font-size: 0.875rem;
}

.gate-summary p:last-child {
    margin-bottom: 0;
}

.status-passed {
    color: #22c55e;
    font-weight: 600;
    font-size: 1rem;
}

.status-failed,
.status-blocked {
    color: #ef4444;
    font-weight: 600;
    font-size: 1rem;
}

.status-running {
    color: #eab308;
    font-weight: 600;
    font-size: 1rem;
}

.status-pending {
    color: #6b7280;
    font-weight: 600;
    font-size: 1rem;
}

.recommendation {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 0 6px rgba(234, 179, 8, 0);
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

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

/* Responsive - Quality Gates */
@media (max-width: 768px) {
    .quality-gates-grid {
        grid-template-columns: 1fr;
    }

    .gate-actions {
        flex-direction: column;
    }

    .btn-retry,
    .btn-view-details {
        width: 100%;
        justify-content: center;
    }
}

/* Activity Timeline */
.activity-timeline {
    position: relative;
    padding-left: 30px;
}

.activity-item {
    position: relative;
    padding-bottom: 20px;
}

.activity-item:last-child {
    padding-bottom: 0;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #3b82f6;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px #3b82f6;
}

.activity-item::after {
    content: '';
    position: absolute;
    left: -21px;
    top: 20px;
    width: 2px;
    height: calc(100% - 10px);
    background-color: #e5e7eb;
}

.activity-item:last-child::after {
    display: none;
}

.activity-header {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.activity-user {
    font-weight: 600;
    color: #111827;
}

.activity-action {
    color: #6b7280;
}

.activity-time {
    font-size: 0.875rem;
    color: #9ca3af;
}

.activity-details {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 5px;
}

/* Sidebar Panels */
.sidebar-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.sidebar-panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 15px 0;
}

.sidebar-field {
    margin-bottom: 15px;
}

.sidebar-field:last-child {
    margin-bottom: 0;
}

.sidebar-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 5px;
}

.sidebar-value {
    color: #111827;
    font-weight: 500;
}

/* Time Tracking */
.time-tracking-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.time-stat {
    background: #ffffff;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
}

.time-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.time-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.time-log-entry {
    background: #ffffff;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.time-log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.time-log-user {
    font-weight: 600;
    color: #111827;
}

.time-log-duration {
    color: #3b82f6;
    font-weight: 600;
}

.time-log-description {
    font-size: 0.875rem;
    color: #6b7280;
}

.time-log-date {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 5px;
}

/* Dependencies */
.dependency-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dependency-item {
    background: #ffffff;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dependency-ticket {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
}

.dependency-ticket:hover {
    text-decoration: underline;
}

.dependency-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.875rem;
}

.dependency-remove:hover {
    color: #dc2626;
}

/* Comments Section */
.comments-section {
    margin-top: 30px;
}

.comment-list {
    margin-bottom: 20px;
}

.comment-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: #111827;
}

.comment-time {
    font-size: 0.875rem;
    color: #9ca3af;
}

.comment-body {
    color: #374151;
    line-height: 1.6;
}

/* File Attachments */
.attachment-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.attachment-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.attachment-item:hover {
    background-color: #f3f4f6;
}

.attachment-icon {
    width: 32px;
    height: 32px;
    background-color: #dbeafe;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 1.125rem;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Forms */
.ticket-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.form-label.required::after {
    content: ' *';
    color: #ef4444;
}

.form-input,
.form-textarea,
.form-select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #111827;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 5px;
}

/* Form Validation States */
.form-group.has-error .form-input,
.form-group.has-error .form-textarea,
.form-group.has-error .form-select {
    border-color: #ef4444;
}

.form-group.has-error .form-input:focus,
.form-group.has-error .form-textarea:focus,
.form-group.has-error .form-select:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 5px;
    display: none;
}

.form-group.has-error .form-error {
    display: block;
}

.form-group.has-success .form-input,
.form-group.has-success .form-textarea,
.form-group.has-success .form-select {
    border-color: #10b981;
}

/* Time Logging Form */
.time-log-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: #ffffff;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover:not(:disabled) {
    background-color: #f9fafb;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-large {
    padding: 12px 24px;
    font-size: 1rem;
}

/* Status Transition Buttons */
.status-transitions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Assignee & Priority Selectors */
.selector-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.selector-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
}

.inline-select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Action Buttons in Detail View */
.ticket-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spinner 0.6s linear infinite;
}

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

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 0.875rem;
}

/* Filter Severity Buttons */
.gate-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #6b7280;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #9ca3af;
    color: #111827;
}

.filter-btn.active {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.filter-btn.error.active {
    background: #ef4444;
    border-color: #ef4444;
}

.filter-btn.warning.active {
    background: #eab308;
    border-color: #eab308;
}

.filter-btn.info.active {
    background: #3b82f6;
    border-color: #3b82f6;
}

.filter-btn.success.active {
    background: #22c55e;
    border-color: #22c55e;
}

/* Score Progress Bar */
.gate-score-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #eab308 50%, #22c55e 100%);
    transition: width 0.3s ease;
}

/* Circular Score Progress */
.gate-score-circle {
    width: 60px;
    height: 60px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.score-circle-text {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

/* Code Snippet in Finding */
.finding-code-snippet {
    background: #1f2937;
    color: #f9fafb;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.75rem;
    margin-top: 8px;
    overflow-x: auto;
    display: none;
}

.gate-finding.expanded .finding-code-snippet {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Gate Loading Overlay */
.gate-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

/* Success/Error Notification Badge */
.gate-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border: 2px solid #22c55e;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.gate-notification.error {
    border-color: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ticket-detail-container {
        grid-template-columns: 1fr;
    }

    .ticket-sidebar {
        order: -1;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .quality-gates-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ticket-modal {
        width: 95%;
        max-height: 95vh;
    }

    .ticket-modal-header,
    .ticket-modal-body,
    .ticket-modal-footer {
        padding: 15px 20px;
    }

    .ticket-title-display {
        font-size: 1.5rem;
    }

    .time-tracking-summary {
        grid-template-columns: 1fr;
    }

    .attachment-list {
        grid-template-columns: 1fr;
    }

    .ticket-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6b7280;
}

.text-danger {
    color: #ef4444;
}

.text-success {
    color: #10b981;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-20 {
    margin-top: 20px;
}

/* ============================================
   WORKFLOW STATUS TRACKING
   ============================================ */

/* Workflow Status Timeline */
.workflow-status-container {
    padding: 30px;
}

.workflow-status-section {
    margin-bottom: 30px;
}

.workflow-status-timeline {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.workflow-timeline-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-left: 2px solid #e5e7eb;
    margin-left: 12px;
    padding-left: 20px;
    position: relative;
}

.workflow-timeline-item:last-child {
    border-left-color: transparent;
}

.workflow-timeline-icon {
    position: absolute;
    left: -13px;
    top: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    background: #ffffff;
    border: 2px solid #e5e7eb;
}

.workflow-timeline-icon.completed {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.workflow-timeline-icon.pending {
    background: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
    animation: pulse 2s ease-in-out infinite;
}

.workflow-timeline-icon.failed {
    background: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

.workflow-timeline-icon.info {
    background: #dbeafe;
    color: #1e40af;
    border-color: #3b82f6;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.workflow-timeline-content {
    flex: 1;
}

.workflow-timeline-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.workflow-timeline-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.workflow-timeline-subtitle a {
    color: #3b82f6;
    text-decoration: none;
}

.workflow-timeline-subtitle a:hover {
    text-decoration: underline;
}

.workflow-timeline-details {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 8px;
}

.workflow-gate-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.workflow-gate-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #ffffff;
    border-radius: 6px;
    font-size: 0.875rem;
}

.workflow-gate-item.passed {
    color: #065f46;
    border-left: 3px solid #10b981;
}

.workflow-gate-item.failed {
    color: #991b1b;
    border-left: 3px solid #ef4444;
}

.workflow-gate-item.pending {
    color: #92400e;
    border-left: 3px solid #f59e0b;
}

/* ============================================
   WORKER STATUS INDICATORS
   Real-time autonomous worker status display
   ============================================ */

/* Worker Status Banner */
.worker-status-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: slideDown 0.3s ease-out;
}

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

.worker-status-banner.worker-status-working {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.worker-status-banner.worker-status-completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.worker-status-banner.worker-status-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.worker-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.worker-status-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.worker-status-icon {
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.worker-status-icon.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.worker-status-label {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.worker-status-time {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.875rem;
    opacity: 0.95;
}

.worker-elapsed {
    font-weight: 600;
    font-family: 'Monaco', 'Courier New', monospace;
}

.worker-last-update {
    opacity: 0.8;
}

.worker-status-activity {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 16px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    margin-bottom: 12px;
}

.worker-activity-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.worker-activity-icon.spinner {
    animation: spin 2s linear infinite;
}

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

.worker-activity-text {
    flex: 1;
    line-height: 1.5;
    font-size: 0.9375rem;
}

.worker-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.worker-progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
        opacity: 1;
    }
    50% {
        width: 100%;
        opacity: 0.8;
    }
    100% {
        width: 0%;
        opacity: 1;
    }
}

/* Activity Timeline Updates */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #e5e7eb;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
}

.activity-item.worker-activity .activity-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.activity-item.user-activity .activity-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-header {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.activity-user {
    font-weight: 600;
    color: #111827;
}

.activity-action {
    color: #6b7280;
}

.activity-message {
    color: #374151;
    font-size: 0.9375rem;
    margin-bottom: 5px;
    line-height: 1.5;
}

.activity-time {
    font-size: 0.875rem;
    color: #9ca3af;
}

.activity-details {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 5px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 4px;
    border-left: 3px solid #d1d5db;
}

/* Worker Activity Badge on Kanban Card */
.kanban-card-worker-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    animation: pulse 2s ease-in-out infinite;
    z-index: 10;
}

.kanban-card-worker-badge.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    animation: none;
}

.kanban-card-worker-badge.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: none;
}

/* Loading States */
.worker-status-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .worker-status-banner {
        padding: 15px;
    }

    .worker-status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .worker-status-time {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        width: 100%;
    }

    .worker-status-activity {
        flex-direction: column;
        gap: 8px;
    }
}

/* ============================================
   DEPENDENCY SELECTOR MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay .modal-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e8ed;
}

.modal-overlay .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #14171a;
}

.modal-overlay .modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #657786;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-overlay .modal-close:hover {
    background-color: #f5f8fa;
    color: #14171a;
}

.modal-overlay .modal-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.modal-overlay .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e1e8ed;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.dependency-option {
    padding: 12px;
    border-bottom: 1px solid #e1e8ed;
    cursor: pointer;
    transition: background 0.2s;
}

.dependency-option:last-child {
    border-bottom: none;
}

.dependency-option:hover {
    background-color: #f5f8fa;
}

.dependency-option:active {
    background-color: #e8f5fe;
}

/* Form control for search */
.modal-overlay .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd9de;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.modal-overlay .form-control:focus {
    outline: none;
    border-color: #1da1f2;
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.1);
}

/* Status and priority badges in dependency selector */
.dependency-option .status-badge,
.dependency-option .priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.dependency-option .status-badge {
    background-color: #e1e8ed;
    color: #657786;
}

.dependency-option .status-backlog {
    background-color: #f0f0f0;
    color: #666;
}

.dependency-option .status-todo {
    background-color: #fff3cd;
    color: #856404;
}

.dependency-option .status-in_progress,
.dependency-option .status-in-progress {
    background-color: #cfe2ff;
    color: #084298;
}

.dependency-option .status-code_review,
.dependency-option .status-code-review {
    background-color: #e7d4ff;
    color: #5a1d7d;
}

.dependency-option .status-testing {
    background-color: #fff4e6;
    color: #cc7700;
}

.dependency-option .status-beta {
    background-color: #d1ecf1;
    color: #0c5460;
}

.dependency-option .status-done {
    background-color: #d4edda;
    color: #155724;
}

.dependency-option .priority-badge {
    background-color: #e1e8ed;
    color: #657786;
}

.dependency-option .priority-high {
    background-color: #f8d7da;
    color: #721c24;
}

.dependency-option .priority-medium {
    background-color: #fff3cd;
    color: #856404;
}

.dependency-option .priority-low {
    background-color: #d1ecf1;
    color: #0c5460;
}
