/**
 * Alert & Attribution Analysis Styles
 * ====================================
 */

/* Modal Overlay */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

/* Close Button */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Tab Buttons */
.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #706e6b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #0176d3;
}

.tab-btn.active {
    color: #0176d3;
    border-bottom-color: #0176d3;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #d8dde6;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #0176d3;
    box-shadow: 0 0 0 3px rgba(1, 118, 211, 0.1);
}

.form-control::placeholder {
    color: #999;
}

/* Buttons */
.btn-primary {
    background-color: #0176d3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #005fb2;
}

.btn-primary:disabled {
    background-color: #d8dde6;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #fff;
    color: #0176d3;
    border: 1px solid #0176d3;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #f4f6f9;
}

.btn-link {
    background: none;
    border: none;
    color: #0176d3;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.btn-link:hover {
    color: #005fb2;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #d8dde6;
    border-radius: 4px;
    overflow: hidden;
}

.data-table thead {
    background-color: #f4f6f9;
}

.data-table th {
    text-align: left;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 13px;
    color: #3e3e3c;
    border-bottom: 2px solid #d8dde6;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Content Panel */
.content-panel {
    background: white;
    border: 1px solid #d8dde6;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background-color: #ffa500;
    color: white;
}

.status-completed {
    background-color: #2e7d32;
    color: white;
}

.status-failed {
    background-color: #c23934;
    color: white;
}

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

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0176d3;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Node Input Rows */
.node-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

/* Attribution Chart Container */
#attributionChart {
    max-width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #706e6b;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
    margin-bottom: 30px;
}

/* Error Message */
.error-message {
    background: #fef7f7;
    border: 1px solid #c23934;
    border-radius: 4px;
    padding: 15px;
    color: #c23934;
    margin: 20px 0;
}

/* Success Message */
.success-message {
    background: #f0f9ff;
    border: 1px solid #0176d3;
    border-radius: 4px;
    padding: 15px;
    color: #0176d3;
    margin: 20px 0;
}

/* Progress Bar */
.progress-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0176d3, #005fb2);
    transition: width 0.5s ease;
}

/* Attribution Bar Chart */
.attribution-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.attribution-bar-label {
    flex: 0 0 150px;
    font-weight: 600;
    text-align: right;
    font-size: 14px;
}

.attribution-bar-visual {
    flex: 1;
    height: 30px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.attribution-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0176d3, #005fb2);
    transition: width 0.5s ease;
}

.attribution-bar-value {
    flex: 0 0 60px;
    font-weight: 600;
    font-size: 14px;
}

/* Loading State */
.loading-container {
    text-align: center;
    padding: 40px;
}

.loading-text {
    color: #706e6b;
    margin-top: 15px;
}

/* Observation Sets */
.observation-set {
    position: relative;
    transition: all 0.2s ease;
}

.observation-set:hover {
    border-color: #0176d3 !important;
    box-shadow: 0 2px 8px rgba(1, 118, 211, 0.1);
}

/* Form Input Improvements */
.form-control {
    border: 1px solid #d0d0d0;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #0176d3;
    box-shadow: 0 0 0 3px rgba(1, 118, 211, 0.1);
}

.form-control:hover {
    border-color: #0176d3;
}

/* Node input rows */
#observationSetsContainer .form-control {
    font-size: 14px;
    padding: 10px 12px;
}

/* Remove button hover effect */
button[onclick*="removeNodeInput"]:hover {
    background: #bb2d3b !important;
    transform: scale(1.05);
}

/* Impact Bar Styles (matching rca-web-app-temp) */
.impact-bar {
    display: inline-block;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.3s ease;
}

.impact-bar.positive {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.impact-bar.negative {
    background: linear-gradient(135deg, #4ade80 0%, #4facfe 100%);
}
