/* ==========================================================================
   DataCleanse Studio - Tabs CSS (Tab-Specific Layouts, Margins, Forms & Grids)
   ========================================================================== */

/* Main Layout & Navigation Tabs */
.app-main {
    padding: 1.2rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.2rem;
    padding-bottom: 0;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    border-radius: 6px 6px 0 0;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--accent-indigo);
    border-bottom-color: var(--accent-indigo);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   Tab 1: Health & Overview
   ========================================== */

.upload-hero-card {
    background: var(--bg-card);
    border: 2px dashed rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-lg);
    padding: 2.2rem 1.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.upload-hero-card:hover, .upload-hero-card.drag-over {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.upload-hero-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem auto;
}

.upload-hero-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.upload-hero-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.1rem;
}

.upload-formats {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.format-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 1.4rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bg-indigo { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }
.bg-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.bg-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.bg-rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.bg-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }

.card-label {
    font-size: 0.76rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-info h3 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.insight-item {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-indigo);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.65;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.insight-item:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
    border-left-color: var(--accent-violet);
}

/* ==========================================
   Tab 2: Clean & Fix Data
   ========================================== */

.auto-clean-box {
    border-radius: var(--radius-md);
    padding: 1.8rem 2.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

body.dark-theme .auto-clean-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(99, 102, 241, 0.12) 100%);
    border: 1px solid rgba(16, 185, 129, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.light-theme .auto-clean-box {
    background: linear-gradient(135deg, #ecfdf5 0%, #e0e7ff 100%);
    border: 1px solid #a7f3d0;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}

.auto-clean-text h4 {
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.auto-clean-text p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.btn-emerald {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    border: none;
    padding: 12px 26px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-emerald:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.5);
}

.form-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-indigo);
    margin-top: 1.8rem;
    margin-bottom: 1.2rem;
}

.strategies-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.strategy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card-hover);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
    gap: 16px;
}

.strategy-row:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.strategy-row span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.checkbox-card {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.checkbox-card:hover {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.08);
}

.audit-log-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audit-log-list li {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ==========================================
   Tab 3: Find Connections (Correlation)
   ========================================== */

.controls-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.bar-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.bar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-controls label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.heatmap-grid-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem;
    overflow-x: auto;
}

.heatmap-table {
    border-collapse: separate;
    border-spacing: 6px;
    margin: 0 auto;
    font-size: 0.92rem;
}

.heatmap-table th {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-align: center;
}

.heatmap-cell {
    width: 72px;
    height: 54px;
    text-align: center;
    vertical-align: middle;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    z-index: 10;
}

.correlation-pairs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.corr-pair-card {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.corr-pair-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(4px);
}

.corr-pair-vars {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-primary);
}

/* ==========================================
   Tab 4: Demographics & Trends
   ========================================== */

.survival-summary-card {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-sm);
    padding: 1.2rem 1.4rem;
}

.survival-summary-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent-indigo);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
}

.stat-row:last-child {
    border-bottom: none;
}

.demographics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.demo-chart-box {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.4rem 1.6rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 4px 10px -2px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.demo-chart-box:hover {
    transform: translateY(-4px) scale(1.015);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 16px 35px -5px rgba(99, 102, 241, 0.25);
}

.demo-chart-box h4 {
    font-size: 0.92rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-chart-canvas-container {
    filter: drop-shadow(0 12px 20px rgba(99, 102, 241, 0.25));
    transition: transform 0.3s ease;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

#trendChart3D {
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
    border-radius: var(--radius-md);
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 80%);
}

.demo-chart-canvas-container:hover {
    transform: perspective(600px) rotateX(8deg);
}

/* ==========================================
   Tab 5: Search & Export
   ========================================== */

.table-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 12px 18px 12px 46px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.export-buttons {
    display: flex;
    gap: 12px;
}

.pagination-bar {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    gap: 10px;
}
