/* ========================================
   MODAL & INVESTIGATION PANEL STYLES
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    border-radius: 16px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 59, 48, 0.2);
    transform: rotate(90deg);
}

.alert-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.meta-item i {
    color: var(--accent-color);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-high {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.badge-medium {
    background: rgba(255, 149, 0, 0.2);
    color: #ff9500;
}

.badge-low {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.modal-details {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item strong {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.detail-item span, .detail-item p {
    color: var(--text-primary);
    font-size: 1rem;
}

.modal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.btn-action {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-investigate {
    background: rgba(10, 132, 255, 0.2);
    color: #0a84ff;
    border: 1px solid rgba(10, 132, 255, 0.3);
}

.btn-investigate:hover {
    background: rgba(10, 132, 255, 0.3);
    transform: translateY(-2px);
}

.btn-resolve {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.btn-resolve:hover {
    background: rgba(52, 199, 89, 0.3);
    transform: translateY(-2px);
}

.btn-dismiss {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.btn-dismiss:hover {
    background: rgba(255, 59, 48, 0.3);
    transform: translateY(-2px);
}

.btn-note {
    background: rgba(255, 149, 0, 0.2);
    color: #ff9500;
    border: 1px solid rgba(255, 149, 0, 0.3);
}

.btn-note:hover {
    background: rgba(255, 149, 0, 0.3);
    transform: translateY(-2px);
}

/* Investigation Panel */
.investigation-panel {
    position: fixed;
    top: 5%;
    right: 2%;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    border-radius: 16px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.investigation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.investigation-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.investigation-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.investigation-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table td:first-child {
    color: var(--text-secondary);
    width: 40%;
}

.data-table td:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.order-item, .payment-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.timeline-icon.blue {
    background: rgba(10, 132, 255, 0.2);
    color: #0a84ff;
}

.timeline-icon.green {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.timeline-icon.red {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.timeline-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.timeline-text {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.investigation-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Alert Severity Styles */
.alert-item.severity-high {
    border-left: 3px solid #ff3b30;
}

.alert-item.severity-medium {
    border-left: 3px solid #ff9500;
}

.alert-item.severity-low {
    border-left: 3px solid #34c759;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .investigation-panel {
        width: 95%;
        right: 2.5%;
        top: 2.5%;
        max-height: 95vh;
    }
    
    .modal-actions {
        grid-template-columns: 1fr;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
}
