/* --- MODAL STYLES --- */
.ts-modal-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.ts-modal-content {
    position: relative;
    max-height: 90vh; 
    width: 95%;
    max-width: 1200px;
    background: #ffffff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #081126 !important;
    display: flex;
    flex-direction: column; 
}

/* Crucial for nested flexbox scrolling */
#ts-quiz-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; 
}

.ts-step-body {
    overflow-y: auto;
    flex: 1;
    padding-right: 15px; 
}

.ts-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #081126;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.ts-modal-close:hover {
    color: #e67e22;
}

/* --- GRID STYLES (Steps 1 & 2) --- */
.ts-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.ts-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 250px;
    cursor: pointer;
}

.ts-card {
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    padding: 30px;
    transition: all 0.2s ease;
    text-align: center;
    background: #f8fafc;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.ts-grid-item:hover .ts-card {
    border-color: #3498db;
    background: #ebf5fb;
}

.ts-grid-item.selected .ts-card {
    border-color: #51b300;
    background: #fdf2e9;
    box-shadow: 0 0 0 1px #a9a9a9;
}

.ts-card img {
    max-width: 140px;
    height: auto;
}

.ts-grid-text {
    text-align: center;
    width: 100%;
}

.ts-grid-text h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: #3498db !important; 
    text-decoration: underline;
}

.ts-grid-text ul {
    text-align: left;
    margin: 0 auto;
    display: inline-block;
    padding-left: 20px;
    font-size: 0.9rem;
    color: #081126 !important;
}

/* --- TABLE STYLES (Steps 3+) --- */
.ts-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
}

.ts-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.ts-table th {
    background: #0d334c !important; 
    color: #ffffff !important; 
    padding: 12px 15px;
    font-weight: 600;
    border-bottom: 2px solid #e0e6ed;
}

.ts-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e6ed;
    color: #081126;
    vertical-align: middle;
}

/* Fix theme border overrides on outer edges */
.ts-table th:first-child, .ts-table td:first-child { border-left: none !important; }
.ts-table th:last-child, .ts-table td:last-child { border-right: none !important; }

/* Bolds the first data column */
.ts-table tbody tr td:nth-child(2) {
    font-weight: 700;
}

.ts-table tbody tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

.ts-table tbody tr:hover { background: #f0f8ff; }
.ts-table tbody tr.selected { background: #fdf2e9; }
.ts-table tbody tr:last-child td { border-bottom: none; }

/* --- Child Rows for Sub-Options --- */
.ts-table tbody tr.ts-child-row {
    background-color: #f8fafc;
}
.ts-table tbody tr.ts-child-row:hover {
    background-color: #f0f8ff;
}
.ts-table tbody tr.ts-child-row.selected {
    background: #fdf2e9;
}
.ts-table tbody tr.ts-child-row td:nth-child(2) {
    font-weight: 500; /* Removes heavy bolding on sub-options */
}

.ts-radio-cell, .ts-check-cell {
    width: 40px;
    text-align: center;
}

.ts-radio-cell input, .ts-check-cell input {
    transform: scale(1.2);
    cursor: pointer;
}

/* --- HEADER & INFO PANELS & BUTTONS --- */
.ts-header {
    text-align: center;
    margin-bottom: 30px;
}

.ts-header h2, .elementor-kit-11 h2 {
    color: #081126 !important;
    margin-bottom: 10px;
}

.ts-info-panel {
    background: #f4f6f7;
    padding: 25px;
    border-left: 4px solid #3498db;
    margin-bottom: 30px;
    border-radius: 0 8px 8px 0;
    color: #081126 !important;
}

.ts-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    text-align: left;
}

.ts-info-panel h3, .ts-info-grid h3 {
    color: #081126 !important;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.ts-info-panel ul {
    margin-top: 0;
    padding-left: 20px;
}

.ts-info-panel li {
    font-size: 0.85rem;
    margin-bottom: 6px;
    line-height: 1.4;
}

.ts-nav-buttons {
    display: flex;
    justify-content: center; 
    gap: 20px; 
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0; 
}

.ts-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ts-btn-prev {
    background: #ecf0f1;
    color: #081126;
}

.ts-btn-prev:hover { background: #bdc3c7; }

.ts-btn-next {
    background: #006C9B;
    color: #fff;
}

.ts-btn-next:hover { background: #0d334c; }

.ts-btn-next:disabled {
    background: #006C9B;
    cursor: not-allowed;
    opacity: .5;
}

.ts-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ts-summary-table th, .ts-summary-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.ts-summary-table th {
    background: #0d334c !important;
    color: #ffffff !important;
    width: 30%;
}