/* Components: Tabs, Cards, Forms, and Reusable Elements */

/* Tab System */
.tab-container {
    margin-bottom: 40px;
}

.tab-navigation {
    display: flex;
    background: var(--card-bg-alt);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow);
    position: relative;
    z-index: 10;
    margin-bottom: -1px;
}

.tab-button {
    flex: 1;
    background: var(--card-bg);
    color: var(--text-muted);
    border: none;
    padding: 20px 15px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    border-right: 1px solid var(--border-color);
    position: relative;
}

.tab-button:first-child {
    border-radius: 12px 0 0 0;
}

.tab-button:last-child {
    border-right: none;
    border-radius: 0 12px 0 0;
}

.tab-button:hover {
    background: #636e72;
    color: var(--text-color);
}

html[data-theme="light"] .tab-button:hover {
    background: #e9ecef;
    color: var(--text-color);
}

.tab-button.active {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-primary);
}

.tab-content {
    background: var(--card-bg-alt);
    border-radius: 0 0 12px 12px;
    min-height: 500px;
    box-shadow: 0 2px 4px var(--shadow);
}

html[data-theme="light"] .tab-content {
    background: #fafafa;
}

html[data-theme="light"] .tab-navigation {
    background: var(--card-bg);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Tab content specific padding */
#investigations {
    padding: 30px;
}

#about {
    padding: 15px 30px 30px;
}

#methodology {
    padding: 20px 30px 30px;
}

/* Search and Filters */
.search-filters {
    background: transparent;
    padding: 0;
    margin: 0 0 20px 0;
}

.search-bar {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1em;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--input-focus);
}

.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 28px 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Theme-specific select arrows */
:root .filter-select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23adb5bd" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
}

html[data-theme="light"] .filter-select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23495057" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
}

.results-count {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-top: 10px;
}

/* Case Cards */
.case-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px var(--shadow);
    transition: all 0.3s ease;
    margin-bottom: 20px;
    display: block;
}

.case-card:hover {
    transform: translateY(-5px);
}

.case-card.featured {
    position: relative;
    background: url('../cases/charlotte-transit/assets/case-image.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 350px;
    display: flex;
    align-items: center;
}

.case-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.0) 20%, rgba(0,0,0,0.35) 80%);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.case-card.featured .case-title {
    color: #ffffff;
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 15px;
    line-height: 1.2;
    border-bottom: 2px solid #ffffff;
    padding-bottom: 10px;
}

.case-card.featured .case-meta {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.case-card.featured .case-meta span {
    background: var(--overlay-bg);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.case-card.featured .case-summary {
    color: #e9ecef;
    font-size: 1.1em;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    margin-bottom: 25px;
}

.case-card.featured .case-links {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.case-link {
    background: var(--accent-primary);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.case-link:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.case-link.secondary {
    background: var(--accent-primary);
    border: 1px solid rgba(255,255,255,0.3);
}

.case-link.secondary:hover {
    background: #1d4ed8;
}

/* Content Boxes */
.mission-box, .methodology-step {
    background: var(--card-bg);
    border-left: 4px solid var(--accent-primary);
    padding: 25px;
    margin: 10px 0 25px;
    border-radius: 8px;
}

html[data-theme="light"] .mission-box,
html[data-theme="light"] .methodology-step {
    background: var(--card-bg);
}

.mission-box h3, .methodology-step h4 {
    color: var(--heading-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 1px solid var(--accent-primary);
    padding-bottom: 8px;
}

.mission-box p, .methodology-step p {
    color: var(--text-muted);
    margin-bottom: 0;
    font-size: 1.1em;
    font-weight: 500;
}

.value-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-success);
}

html[data-theme="light"] .value-card {
    background: var(--card-bg);
}

.value-card h4 {
    color: var(--heading-color);
    margin-bottom: 10px;
    font-size: 1.1em;
    border-bottom: 1px solid var(--accent-success);
    padding-bottom: 8px;
}

.value-card p {
    color: var(--text-muted);
    margin-bottom: 0;
    font-size: 0.95em;
}

/* Grids */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.process-card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.process-number {
    background: var(--accent-primary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.process-title {
    color: var(--heading-color);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.process-description {
    color: var(--text-muted);
    font-size: 0.8em;
    line-height: 1.4;
}

/* Content sections */
.content-section h2 {
    color: var(--heading-color);
}

.content-section h3 {
    color: var(--heading-color);
}

.content-section p {
    color: var(--text-muted);
}

.content-section ul,
.content-section ol {
    color: var(--text-muted);
}