/**
 * Tesla Software Updates — Minimal Styles
 * Designed to blend with TeslaMagz theme.
 */

/* ---- Layout ---- */
.tsu-page {
    max-width: 780px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.tsu-page__container {
    max-width: 780px;
    margin: 0 auto;
}

/* ---- Back Link ---- */
.tsu-back {
    display: inline-block;
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.15s;
}

.tsu-back:hover {
    color: #e31937;
}

/* ---- Page Header ---- */
.tsu-page__header {
    margin-bottom: 2.5rem;
}

.tsu-page__title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0.4rem 0 0.6rem;
    line-height: 1.25;
}

.tsu-page__subtitle {
    color: #777;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

.tsu-version-tag {
    display: inline-block;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f0f0f0;
    padding: 0.25rem 0.7rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.tsu-page__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.75rem;
}

.tsu-page__meta span::before {
    content: "·";
    margin-right: 0;
}

.tsu-page__meta span:first-child::before {
    content: "";
    margin-right: 0;
}

.tsu-page__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}

.tsu-tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    color: #555;
}

/* ---- Release Notes (entry-content within our template) ---- */
.tsu-release-notes {
    margin-bottom: 3rem;
}

.tsu-release-notes .entry-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 2.5rem 0 0.75rem;
    line-height: 1.3;
}

.tsu-release-notes .entry-content h3:first-child {
    margin-top: 0;
}

.tsu-release-notes .entry-content figure {
    margin: 0 0 1rem;
}

.tsu-release-notes .entry-content figure img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

.tsu-release-notes .entry-content p {
    font-size: 0.95rem;
    line-height: 1.75;
    color: #444;
    margin: 0 0 0.75rem;
}

.tsu-release-notes .entry-content p:last-child {
    margin-bottom: 0;
}

.tsu-release-notes .entry-content .tsu-compatible-models {
    font-size: 0.82rem;
    color: #777;
    padding: 0.5rem 0.75rem;
    background: #f8f8f8;
    border-radius: 6px;
    border-left: 3px solid #e31937;
    margin: 0.5rem 0 1.5rem;
}

/* ---- Availability ---- */
.tsu-availability {
    margin-bottom: 2.5rem;
}

.tsu-section-heading {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #333;
}

.tsu-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tsu-country {
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* ---- Prev/Next Nav ---- */
.tsu-page__nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    margin-top: 2rem;
}

.tsu-page__nav-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tsu-page__nav-link small {
    font-size: 0.75rem;
    color: #999;
}

.tsu-page__nav-link span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    font-family: "SF Mono", "Fira Code", monospace;
}

.tsu-page__nav-link:hover span {
    color: #e31937;
}

.tsu-page__nav-link--next {
    text-align: right;
    margin-left: auto;
}

/* ---- Archive: Filters ---- */
.tsu-filters {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tsu-filters__search {
    flex: 1;
    min-width: 180px;
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}

.tsu-filters__search:focus {
    border-color: #bbb;
}

.tsu-filters__select {
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.tsu-filters__clear {
    font-size: 0.82rem;
    color: #999;
    text-decoration: none;
}

.tsu-filters__clear:hover {
    color: #e31937;
}

/* ---- Archive: List ---- */
.tsu-list {
    display: flex;
    flex-direction: column;
}

.tsu-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    transition: background 0.1s;
    margin: 0 -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: 6px;
}

.tsu-list__item:first-child {
    border-top: 1px solid #f0f0f0;
}

.tsu-list__item:hover {
    background: #fafafa;
}

.tsu-list__main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.tsu-list__version {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.8rem;
    font-weight: 600;
    background: #1a1a2e;
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tsu-list__title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tsu-list__details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.tsu-list__detail {
    font-size: 0.78rem;
    color: #999;
    white-space: nowrap;
}

.tsu-list__badge {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    background: #f0f7f0;
    color: #2d7a2d;
    white-space: nowrap;
}

/* ---- Pagination ---- */
.tsu-pagination {
    text-align: center;
    padding: 2rem 0 0;
}

.tsu-pagination .page-numbers {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    margin: 0 0.15rem;
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.1s;
}

.tsu-pagination .page-numbers:hover {
    background: #f5f5f5;
}

.tsu-pagination .page-numbers.current {
    background: #1a1a2e;
    color: #fff;
}

/* ---- Empty State ---- */
.tsu-empty {
    text-align: center;
    padding: 3rem 0;
    color: #999;
    font-size: 0.95rem;
}

/* ---- Stats Widget (shortcode) ---- */
.tsu-stats-widget {
    margin: 1.5rem 0;
}

.tsu-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.tsu-stat-card {
    padding: 1rem;
    text-align: center;
    border: 1px solid #eee;
    border-radius: 8px;
}

.tsu-stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
}

.tsu-stat-label {
    display: block;
    font-size: 0.72rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.2rem;
}

/* ========================================
   DARK MODE — matches TeslaMagz theme
   ======================================== */
[data-scheme="dark"] .tsu-version-tag,
.cs-dark-scheme .tsu-version-tag {
    background: #2a2a3e;
    color: #ccc;
}

[data-scheme="dark"] .tsu-tag,
.cs-dark-scheme .tsu-tag {
    background: #2a2a3e;
    border-color: #3a3a4e;
    color: #aaa;
}

[data-scheme="dark"] .tsu-note,
.cs-dark-scheme .tsu-note {
    border-bottom-color: #2a2a3e;
}

[data-scheme="dark"] .tsu-note__desc,
.cs-dark-scheme .tsu-note__desc,
[data-scheme="dark"] .tsu-release-notes .entry-content p,
.cs-dark-scheme .tsu-release-notes .entry-content p {
    color: #bbb;
}

[data-scheme="dark"] .tsu-release-notes .entry-content .tsu-compatible-models,
.cs-dark-scheme .tsu-release-notes .entry-content .tsu-compatible-models {
    background: #2a2a3e;
    color: #999;
}

[data-scheme="dark"] .tsu-country,
.cs-dark-scheme .tsu-country {
    background: #2a2a3e;
    border-color: #3a3a4e;
}

[data-scheme="dark"] .tsu-section-heading,
.cs-dark-scheme .tsu-section-heading {
    color: #ddd;
}

[data-scheme="dark"] .tsu-page__nav,
.cs-dark-scheme .tsu-page__nav {
    border-top-color: #2a2a3e;
}

[data-scheme="dark"] .tsu-page__nav-link span,
.cs-dark-scheme .tsu-page__nav-link span {
    color: #ddd;
}

[data-scheme="dark"] .tsu-filters__search,
[data-scheme="dark"] .tsu-filters__select,
.cs-dark-scheme .tsu-filters__search,
.cs-dark-scheme .tsu-filters__select {
    background: #1e1e2e;
    border-color: #333;
    color: #ddd;
}

[data-scheme="dark"] .tsu-list__item,
.cs-dark-scheme .tsu-list__item {
    border-bottom-color: #2a2a3e;
}

[data-scheme="dark"] .tsu-list__item:first-child,
.cs-dark-scheme .tsu-list__item:first-child {
    border-top-color: #2a2a3e;
}

[data-scheme="dark"] .tsu-list__item:hover,
.cs-dark-scheme .tsu-list__item:hover {
    background: #1e1e2e;
}

[data-scheme="dark"] .tsu-list__version,
.cs-dark-scheme .tsu-list__version {
    background: #333;
}

[data-scheme="dark"] .tsu-list__title,
.cs-dark-scheme .tsu-list__title {
    color: #eee;
}

[data-scheme="dark"] .tsu-list__badge,
.cs-dark-scheme .tsu-list__badge {
    background: #1a3a1a;
    color: #6dd86d;
}

[data-scheme="dark"] .tsu-pagination .page-numbers:hover,
.cs-dark-scheme .tsu-pagination .page-numbers:hover {
    background: #2a2a3e;
}

[data-scheme="dark"] .tsu-pagination .page-numbers.current,
.cs-dark-scheme .tsu-pagination .page-numbers.current {
    background: #e31937;
}

[data-scheme="dark"] .tsu-stat-card,
.cs-dark-scheme .tsu-stat-card {
    border-color: #333;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .tsu-page {
        padding: 1.5rem 1rem 2rem;
    }

    .tsu-page__title {
        font-size: 1.4rem;
    }

    .tsu-list__item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .tsu-list__details {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .tsu-page__nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    .tsu-page__nav-link--next {
        text-align: left;
    }

    .tsu-filters {
        flex-direction: column;
    }

    .tsu-filters__search {
        min-width: 100%;
    }
}
