.table-responsive {
    /* Ensures it takes up full width of the parent */
    width: 100%; 
    
    /* RE-INTRODUCED: The max-width stops the table from growing beyond this size,
       allowing the parent's 'align-items: center' to visually center the block. */
    max-width: 1200px; 
    
    /* Margin no longer needed for centering if parent handles it, but harmless. */
    margin: 0 auto; 
    
    overflow-x: auto; /* Important for making tables scrollable on mobile */
    padding: 0 10px; /* Optional: adds a little breathing room on the sides */
}

.styled-table.comparison-table {
    width: 100%;
    /* Keep existing table styles (borders, padding, etc.) */
}


.shadbala-planet-selector {
        width: 100%;
        margin: 5px;
        justify-content:center; 
        align-items:center; 
        gap:15px; 
        flex-wrap:wrap; 
        border: 1px solid orange;
}

.shadbala-component-selector {
        width: 100%;
        margin: 5px;
}

.shadbala-component-selector label {
        display: block;
        margin-bottom: 12px;
        font-weight: 600;
        color: #555;
}

.shadbala-checkbox-group {
        width: 100%;
        margin: 0;
}

.shadbala-checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.3s;
}

.shadbala-checkbox-item:hover {
    background: #e9ecef;
}

.shadbala-checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;  /* Prevent checkbox from shrinking */
}

.shadbala-checkbox-item label {
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-weight: normal;
    display: flex;
    flex-direction: column;
}

.shadbala-checkbox-item .component-desc {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 3px;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .shadbala-checkbox-group {
        grid-template-columns: 2fr;  /* Back to 1 column on mobile */
    }
}

.shadbala-select-all-btn {
        width: 100%;
        padding: 10px;
        background: orangered;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 1rem;
        cursor: pointer;
        transition: background 0.3s;
        margin-bottom: 15px;
}

.shadbala-select-all-btn:hover {
    background: orangered;
}

.results-panel {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 400px;
}

.results-placeholder {
    width: 100%;    
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
    
}

.results-placeholder svg {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
        opacity: 0.3;
}

.shadbala-ind-planet-data {
    
    
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    
    z-index: 1001;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.loading {
        text-align: center;
        padding: 40px;
}

.spinner {
        border: 4px solid #f3f3f3;
        border-top: 4px solid #667eea;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        animation: spin 1s linear infinite;
        margin: 0 auto 20px;
}

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

/* Table Styles */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.results-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.results-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.results-table th:first-child {
    padding-left: 20px;
}

.results-table th:last-child {
    text-align: right;
    padding-right: 20px;
}

.results-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s;
}

.results-table tbody tr:hover {
    background: #f8f9fa;
}

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

.results-table td {
    padding: 12px 10px;
    font-size: 0.9rem;
}

.results-table td:first-child {
    padding-left: 20px;
    font-weight: 600;
    color: #333;
}

.results-table td:last-child {
    text-align: right;
    padding-right: 20px;
    font-weight: 600;
    color: #667eea;
}

.results-table .sub-row {
    background: #f8f9fa;
}

.results-table .sub-row td:first-child {
    padding-left: 40px;
    font-weight: normal;
    color: #666;
    font-size: 0.85rem;
}

.results-table .sub-row td:last-child {
    color: #999;
    font-weight: normal;
}

.results-table .total-row {
    background: #e9ecef;
    font-weight: bold;
}

.results-table .total-row td {
    padding: 15px 20px;
    font-size: 1rem;
    color: #333;
}

.results-table .total-row td:last-child {
    color: #667eea;
    font-size: 1.1rem;
}

.summary-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);  /* Force 4 columns */
    gap: 15px;
}

.summary-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);  /* Better card look */
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);  /* Card shadow */
    border: 1px solid #dee2e6;  /* Card border */
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.summary-item .label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.summary-item .value {
    font-size: 2rem;  /* Bigger value */
    font-weight: bold;
    color: #333;
    line-height: 1.2;
}

.summary-item .value.strong {
    color: #28a745;
}

.summary-item .value.weak {
    color: #dc3545;
}

/* Responsive: Stack cards on smaller screens */
@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);  /* 2 columns on tablets */
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;  /* 1 column on mobile */
    }
}

.section-divider {
    margin: 30px 0;
    border-bottom: 2px solid #e9ecef;
}

.expandable-row {
    cursor: pointer;
}

.expandable-row:hover {
    background: #e9ecef !important;
}

.expand-icon {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.3s;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.aspects-list {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85rem;
}

.aspect-item {
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e9ecef;
}

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

.aspect-benefic {
    color: #28a745;
}

.aspect-malefic {
    color: #dc3545;
}

.shadbala-data {
    display: inline-grid; /* Changed from 'grid' to 'inline-grid' */
    grid-template-columns: auto auto;
    align-items: center;
    padding: 2px 10px 2px 2px;
    border-bottom: 1px solid #ddd;
    column-gap: 10px;
    line-height: 0.8;
}

.shadbala-text {
    width: 150px; /* Add explicit width */
    min-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Add ... if text is too long */
}

.shadbala-value {
    white-space: nowrap; /* Prevent value from wrapping */
    color: yellow;
}