/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}
/* Header #060026;*/
.header {
    background: #060026;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.logo-text {
    font-weight: 600;
    font-size: 18px;
    color: white;
}

.class-select {
  border-radius: 4px;
  border: 1px solid #ccc;
  outline: none;
  transition: border-color 0.2s ease;
  padding: 4px 8px;
  font-size: 1em;
}

.class-select:focus {
  border-color: #3262a8;
  box-shadow: 0 0 4px rgba(50, 98, 168, 0.6);
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1rem;
    font-size: 18px;
    font-weight: 545;
    color: #64748b;
    cursor: pointer;
    border-bottom: 4px solid transparent;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #0d024a;
}

.tab-button.active {
    color: #0d024a;
    border-bottom-color: #0d024a;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Controls Section */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.left-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Search and Filter */
.search-container {
    position: relative;
}

.search-input {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    width: 400px;
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.filter-dropdown {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

/* Table */
.table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
}

.table-scroll-top {
    /* This makes the scroll area appear at the top more obviously */
    margin-bottom: 1rem;
    /* You may adjust this to fit your UI */
}

/* Update table to handle dynamic columns */
.assets-table {
    min-width: 600px;
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* Allow dynamic column sizing */
}

.assets-table th,
.assets-table td {
    padding: 0.15rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    /* word-wrap: break-word; */
    white-space: nowrap;        /* Prevent wrapping */
    overflow: hidden;           /* Hide overflow */
    text-overflow: ellipsis;    /* Show "..." for clipped text */
    max-width: 220px;           /* Or an appropriate limit; adjust if needed */
}

/* Make table horizontally scrollable if too many columns */
.table-container {
    overflow-x: auto;
}

/* Adjust for smaller screens */
@media (max-width: 768px) {
    .assets-table th,
    .assets-table td {
        padding: 0.5rem;
        font-size: 13px;
        min-width: 100px;
    }
}

.assets-table tbody tr:hover {
    background: #f8fafc;
}

.asset-link {
    color: #1c3099;
    text-decoration: none;
    font-weight: 500;
}

.asset-link:hover {
    text-decoration: underline;
}

.confidence-score {
    font-weight: 350;
}


/* Status Badges */
.status-badge {
    padding: 0.55rem 0.5rem;
    font-size: 14px;
    font-weight: 350;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fef3c7;
    color: black;
    border: 1px solid #ffd83b;
    border-radius: 5px;
}

.status-confirm {
    background: #d1fae5;
    color: black;
    border: 1px solid #94e4bb;
    border-radius: 5px;
}

.status-denied {
    background: #fee2e2;
    color: black;
    border: 1px solid #ea7a7a;
    border-radius: 5px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.55rem 0.85rem;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn {
    background: #ededed;
    color: black;
    border: 2px solid #e8e8e8;
}

.confirm-btn:hover {
    background: #059669;
}

.deny-btn {
    background: white;
    color: black;
    border: 2px solid #E8E8E8;
}

.deny-btn:hover {
    background: #dc2626;
}

.class-picker {
    max-width: 180px;
    font-size: 0.90em;
    border: 2px solid black;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pagination-info {
    font-size: 14px;
    color: #64748b;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: #f9fafb;
}

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

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-number:hover {
    background: #f9fafb;
}

.page-number.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Decision Tree */
#decision-tree.tab-content {
    padding: 2rem;
    background: #f8fafc;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Textarea Input Styling */
.input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Inter', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    background: white;
    color: #1e293b;
    transition: border-color 0.2s;
}

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

.input::placeholder {
    color: #64748b;
}

/* Action Buttons Container */
.actionBtns {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    align-items: center;
}

/* Button Styling to Match Dashboard Theme */
.applyBtn, .clearBtn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.applyBtn {
    background: #3b82f6;
    color: white;
}

.applyBtn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.clearBtn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.clearBtn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Canvas Container */
canvas {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100% !important; /* Forces canvas to stay within bounds */
    height: 400px;
    max-width: 100%;
}

/* Loading and interaction states */
.input:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
}

.applyBtn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.applyBtn:disabled:hover {
    background-color: #9ca3af;
    transform: none;
    box-shadow: none;
}

/* Canvas focus styling */
canvas:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth transitions for tab switching */
/* #decision-tree.tab-content { */
/*     opacity: 0; */
/*     transition: opacity 0.3s ease-in-out; */
/* } */

#decision-tree.tab-content.active {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    #decision-tree.tab-content {
        padding: 1rem;
    }

    .actionBtns {
        flex-direction: column;
        align-items: stretch;
    }

    .applyBtn, .clearBtn {
        width: 100%;
        justify-content: center;
    }

    canvas {
        height: 400px;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.modal-body {
    padding: 1.5rem;
}

.asset-details {
    display: grid;
    gap: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-label {
    font-weight: 500;
    color: #374151;
}

.detail-value {
    color: #64748b;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.select-all-checkbox,
.header-checkbox {
    width: 12px;
    height: 12px;
}

.row-checkbox {
    width: 16px;
    height: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }

    .controls-section {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .left-controls,
    .right-controls {
        justify-content: center;
    }

    .search-input {
        width: 100%;
    }

    .assets-table {
        font-size: 13px;
    }

    .assets-table th,
    .assets-table td {
        padding: 0.5rem;
    }

    .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }
}

.dashboard-content {
    display: flex;
    flex-direction: row;
    min-height: 600px;
}

.table-section {
    flex: 2 1 0;
    min-width: 0;
}

.vertical-divider {
    width: 2px;
    background: #e2e8f0;
    margin: 0 1.5rem;
}

.asset-info-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    flex: 1 1 0;
    width: 400px;
    min-width: 330px;
    max-width: 90vw;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 2rem 1.5rem;
    margin-left: 0;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.asset-info-placeholder {
    color: #64748b;
    font-style: italic;
    text-align: center;
    margin-top: 3rem;
}

.asset-info-content {
    width: 100%;
    box-sizing: border-box;
}

.asset-info-title {
    font-weight: 600;
    font-size: 20px;
    margin-bottom: 1rem;
    color: #1e293b;
}

.asset-info-table {
    width: 100%;
    margin-bottom: 1.5rem;
    table-layout: fixed;
    border-collapse: collapse;
}

.asset-info-table td {
    padding: 0.35rem 0.5rem;
    vertical-align: top;

    /* Text wrapping safety */
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    border-bottom: 1px solid #eee;
}

.asset-info-table tr td:first-child {
    width: 30%;
    font-weight: bold;
    color: #555;
}

.asset-info-table tr td:last-child {
    width: 65%;
}

.highlight-column {
    background-color: #e9ecef !important; /* Slightly darker grey */
    border-left: 2px solid #dee2e6; /* Optional: adds a nice divider look */
    border-right: 2px solid #dee2e6;
}

.model-decision-path {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Table header sorting/filtering */
.th-content {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #64748b;
    margin-left: 2px;
    padding: 0;
}

.filter-input {
    width: 90%;
    margin-top: 2px;
    padding: 0.2rem 0.4rem;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #f8fafc;
}
