/**
 * TunePulse — Main Stylesheet
 *
 * Layout, typography, buttons, cards, nav, grid, responsive.
 */

/* ------------------------------------------------------------------ */
/* Reset & Base                                                        */
/* ------------------------------------------------------------------ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--tp-bg);
    color: var(--tp-text);
    font-family: var(--tp-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--tp-accent);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

a:hover {
    opacity: 0.85;
}

img {
    max-width: 100%;
    height: auto;
}

/* ------------------------------------------------------------------ */
/* Typography                                                          */
/* ------------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--tp-text);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }

.tp-accent-text {
    color: var(--tp-accent);
}

.tp-dim {
    color: var(--tp-text-dim);
}

/* ------------------------------------------------------------------ */
/* Container                                                           */
/* ------------------------------------------------------------------ */

.tp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.tp-btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    font-family: var(--tp-font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
    border: none;
    text-align: center;
    line-height: 1.4;
}

.tp-btn:hover {
    transform: translateY(-1px);
    opacity: 1;
}

.tp-btn-primary {
    background: var(--tp-accent);
    color: #000;
}

.tp-btn-primary:hover {
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    color: #000;
}

.tp-btn-ghost {
    background: transparent;
    color: var(--tp-accent);
    border: 1px solid var(--tp-accent);
}

.tp-btn-ghost:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--tp-accent);
}

.tp-btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.tp-btn-danger {
    background: var(--tp-danger);
    color: #fff;
}

/* ------------------------------------------------------------------ */
/* Inputs                                                              */
/* ------------------------------------------------------------------ */

.tp-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--tp-surface2);
    border: 1px solid var(--tp-border);
    border-radius: 6px;
    color: var(--tp-text);
    font-family: var(--tp-font);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.tp-input:focus {
    border-color: var(--tp-accent);
}

.tp-input::placeholder {
    color: var(--tp-text-dim);
}

.tp-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--tp-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* ------------------------------------------------------------------ */
/* Nav Bar                                                             */
/* ------------------------------------------------------------------ */

.tp-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--tp-border);
    padding: 0 24px;
}

.tp-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 110px;
}

.tp-nav-logo img {
    height: 100px;
    width: auto;
}

.tp-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.tp-nav-links a {
    color: var(--tp-text-dim);
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.tp-nav-links a:hover {
    color: var(--tp-text);
    background: rgba(255, 255, 255, 0.05);
    opacity: 1;
}

.tp-nav-links .tp-btn {
    padding: 8px 20px;
    font-size: 0.85rem;
}

/* Avatar dropdown */
.tp-avatar-wrap {
    position: relative;
}

.tp-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tp-surface2);
    border: 2px solid var(--tp-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tp-accent);
}

.tp-avatar-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: 8px;
    min-width: 160px;
    padding: 8px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.tp-avatar-menu.open {
    display: block;
}

.tp-avatar-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--tp-text-dim);
    font-size: 0.85rem;
}

.tp-avatar-menu a:hover {
    background: var(--tp-surface2);
    color: var(--tp-text);
    opacity: 1;
}

/* ── Notification bell ─────────────────────────────────── */
.tp-notification-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tp-notification-bell {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 6px;
    color: var(--tp-text-dim);
    position: relative;
    line-height: 1;
}

.tp-notification-bell:hover {
    color: var(--tp-accent);
}

.tp-notification-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #d63638;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.tp-notification-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: 8px;
    min-width: 320px;
    max-width: 380px;
    max-height: 420px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.tp-notification-dropdown.open {
    display: block;
}

.tp-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--tp-border);
}

.tp-notif-header h4 {
    margin: 0;
    font-size: 11px;
    color: var(--tp-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tp-notif-mark-all {
    background: none;
    border: none;
    color: var(--tp-accent);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
}

.tp-notif-mark-all:hover {
    text-decoration: underline;
}

.tp-notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    color: var(--tp-text);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
    border-bottom: 1px solid var(--tp-border);
}

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

.tp-notification-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--tp-text);
    opacity: 1;
}

.tp-notification-item.tp-notif-unread {
    background: rgba(0, 140, 255, 0.06);
}

.tp-notification-item .tp-notif-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.tp-notif-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tp-notif-message {
    line-height: 1.3;
}

.tp-notif-time {
    font-size: 11px;
    color: var(--tp-text-dim);
}

.tp-notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tp-accent);
    flex-shrink: 0;
    margin-top: 5px;
}

.tp-notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--tp-text-dim);
    font-size: 13px;
}

/* Mobile hamburger */
.tp-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
}

.tp-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--tp-text);
    transition: transform 0.2s ease;
}

.tp-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 26, 0.98);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.tp-mobile-overlay.open {
    display: flex;
}

.tp-mobile-overlay a {
    font-size: 1.25rem;
    color: var(--tp-text);
    padding: 12px 24px;
}

.tp-mobile-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 2rem;
    color: var(--tp-text);
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */

.tp-hero {
    background: linear-gradient(135deg, var(--tp-bg) 60%, var(--tp-surface));
    padding: 80px 0;
}

.tp-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 48px;
}

.tp-hero-text {
    flex: 1;
}

.tp-hero-text h1 {
    font-size: 3rem;
    margin-bottom: 16px;
}

.tp-hero-text p {
    font-size: 1.1rem;
    color: var(--tp-text-dim);
    margin-bottom: 32px;
    max-width: 480px;
}

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

.tp-hero-image {
    flex: 0.9;
}

.tp-hero-image img {
    border-radius: 12px;
    border: 1px solid var(--tp-border);
    box-shadow: 0 8px 40px rgba(0, 212, 255, 0.1);
}

/* ------------------------------------------------------------------ */
/* Stats Bar                                                           */
/* ------------------------------------------------------------------ */

.tp-stats {
    background: var(--tp-surface);
    border-top: 1px solid var(--tp-border);
    border-bottom: 1px solid var(--tp-border);
    padding: 40px 0;
}

.tp-stats-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: center;
    gap: 0;
}

.tp-stat {
    flex: 1;
    text-align: center;
    padding: 0 32px;
}

.tp-stat + .tp-stat {
    border-left: 1px solid var(--tp-border);
}

.tp-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--tp-accent);
    line-height: 1;
}

.tp-stat-label {
    font-size: 0.85rem;
    color: var(--tp-text-dim);
    margin-top: 4px;
}

/* ------------------------------------------------------------------ */
/* Features                                                            */
/* ------------------------------------------------------------------ */

.tp-features {
    padding: 80px 0;
}

.tp-features h2 {
    text-align: center;
    margin-bottom: 48px;
}

.tp-features-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tp-feature-card {
    background: var(--tp-surface);
    border-radius: 12px;
    padding: 24px;
    border-left: 3px solid var(--tp-accent);
}

.tp-feature-card h3 {
    margin-bottom: 8px;
}

.tp-feature-card p {
    font-size: 0.9rem;
    color: var(--tp-text-dim);
}

/* ------------------------------------------------------------------ */
/* Showcase                                                            */
/* ------------------------------------------------------------------ */

.tp-showcase {
    padding: 60px 0 80px;
}

.tp-showcase h2 {
    text-align: center;
    margin-bottom: 40px;
}

.tp-showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.tp-showcase-item {
    text-align: center;
}

.tp-showcase-item img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--tp-border);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    margin-bottom: 16px;
}

.tp-showcase-item h3 {
    margin-bottom: 4px;
}

.tp-showcase-item p {
    font-size: 0.9rem;
    color: var(--tp-text-dim);
}

/* ------------------------------------------------------------------ */
/* How It Works                                                        */
/* ------------------------------------------------------------------ */

.tp-how {
    padding: 60px 0;
    background: var(--tp-surface);
    border-top: 1px solid var(--tp-border);
    border-bottom: 1px solid var(--tp-border);
}

.tp-how h2 {
    text-align: center;
    margin-bottom: 48px;
}

.tp-how-steps {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tp-how-step {
    flex: 1;
    text-align: center;
}

.tp-how-step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tp-accent);
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.tp-how-step h3 {
    margin-bottom: 4px;
}

.tp-how-step p {
    font-size: 0.85rem;
    color: var(--tp-text-dim);
}

.tp-how-arrow {
    color: var(--tp-text-dim);
    font-size: 1.5rem;
    padding-top: 8px;
}

/* ------------------------------------------------------------------ */
/* CTA                                                                 */
/* ------------------------------------------------------------------ */

.tp-cta {
    padding: 80px 0;
    text-align: center;
}

.tp-cta h2 {
    margin-bottom: 24px;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.tp-footer {
    background: var(--tp-bg);
    border-top: 1px solid var(--tp-border);
    padding: 32px 0;
    text-align: center;
}

.tp-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tp-footer-logo img {
    height: 48px;
}

.tp-footer-copy {
    font-size: 0.8rem;
    color: var(--tp-text-dim);
}

.tp-footer-links {
    display: flex;
    gap: 16px;
    list-style: none;
}

.tp-footer-links a {
    font-size: 0.8rem;
    color: var(--tp-text-dim);
}

/* ------------------------------------------------------------------ */
/* Dashboard                                                           */
/* ------------------------------------------------------------------ */

.tp-dashboard {
    padding: 40px 0;
    min-height: calc(100vh - 110px);
}

.tp-welcome {
    margin-bottom: 32px;
}

.tp-welcome h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.tp-welcome-stats {
    color: var(--tp-text-dim);
    font-size: 0.9rem;
}

.tp-welcome-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* Upload zone */
.tp-upload-zone {
    border: 2px dashed var(--tp-border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    margin-bottom: 32px;
}

.tp-upload-zone:hover,
.tp-upload-zone.dragover {
    border-color: var(--tp-accent);
    background: rgba(0, 212, 255, 0.03);
}

.tp-upload-zone p {
    color: var(--tp-text-dim);
    margin-top: 8px;
}

.tp-upload-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

/* Vehicle grid */
.tp-vehicle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.tp-vehicle-card {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    padding: 24px;
    transition: border-color 0.15s ease;
}

.tp-vehicle-card:hover {
    border-color: var(--tp-accent);
}

.tp-vehicle-card h3 {
    margin-bottom: 8px;
}

.tp-vehicle-meta {
    font-size: 0.82rem;
    color: var(--tp-text-dim);
    margin-bottom: 16px;
    line-height: 1.8;
}

.tp-vehicle-card .tp-btn {
    width: 100%;
}

.tp-health-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.tp-health-dot.ok { background: var(--tp-good); }
.tp-health-dot.warning { background: var(--tp-warn); }
.tp-health-dot.critical { background: var(--tp-danger); }

.tp-vehicle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.tp-vehicle-card-header h3 {
    margin-bottom: 0;
}

.tp-vehicle-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.tp-shared-by {
    font-size: 0.8rem; color: var(--tp-accent); margin: -4px 0 6px;
    padding: 0 2px;
}

.tp-btn-icon {
    background: none;
    border: 1px solid var(--tp-border);
    border-radius: 6px;
    color: var(--tp-text-dim);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s;
}

.tp-btn-icon:hover {
    color: var(--tp-text);
    border-color: var(--tp-text-dim);
}

.tp-btn-icon-danger:hover {
    color: var(--tp-danger);
    border-color: var(--tp-danger);
}

.tp-btn-icon-sm {
    font-size: 0.75rem;
    padding: 2px 6px;
}

.tp-vehicle-edit-form {
    display: none;
    background: var(--tp-bg);
    border: 1px solid var(--tp-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.tp-vehicle-edit-form.open {
    display: block;
}

.tp-vehicle-edit-form .tp-form-group {
    margin-bottom: 10px;
}

.tp-form-actions {
    display: flex;
    gap: 8px;
}

.tp-vehicle-logs {
    border-top: 1px solid var(--tp-border);
    margin-top: 12px;
    padding-top: 8px;
}

.tp-log-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.8rem;
}

.tp-log-row + .tp-log-row {
    border-top: 1px solid rgba(255,255,255,0.05);
}

.tp-log-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tp-log-label {
    color: var(--tp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-log-date {
    color: var(--tp-text-dim);
    font-size: 0.72rem;
}

.tp-log-actions {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}

.tp-log-edit-form {
    display: none; padding: 6px 0 2px;
}
.tp-log-edit-form.open { display: block; }
.tp-log-edit-form .tp-input-sm {
    font-size: 0.82rem; padding: 6px 8px;
}
.tp-log-edit-actions {
    display: flex; gap: 6px;
}
.tp-btn-xs {
    font-size: 0.72rem; padding: 3px 10px; border-radius: 4px;
}

.tp-clickable-card { cursor: pointer; }

/* Inline add vehicle form */
.tp-add-vehicle-form {
    display: none;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.tp-add-vehicle-form.open {
    display: block;
}

.tp-add-vehicle-form .tp-form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.tp-form-group {
    flex: 1;
}

.tp-form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--tp-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* Empty state */
.tp-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--tp-text-dim);
}

.tp-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.tp-empty p {
    margin-bottom: 20px;
}

/* ------------------------------------------------------------------ */
/* Alerts                                                              */
/* ------------------------------------------------------------------ */

.tp-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.tp-alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--tp-danger);
    color: var(--tp-danger);
}

.tp-alert-success {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid var(--tp-good);
    color: var(--tp-good);
}

.tp-alert-warning {
    background: rgba(219, 166, 23, 0.1);
    border: 1px solid #dba617;
    color: #dba617;
}

/* ------------------------------------------------------------------ */
/* Confirm Modal                                                       */
/* ------------------------------------------------------------------ */

.tp-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.tp-modal-overlay.open {
    display: flex;
}

.tp-modal {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: tp-modal-in 0.15s ease-out;
}

@keyframes tp-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.tp-modal-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.8;
}

.tp-modal h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.tp-modal p {
    color: var(--tp-text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.tp-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.tp-btn-danger {
    background: var(--tp-danger);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.tp-btn-danger:hover {
    background: #e55a5a;
}

/* ------------------------------------------------------------------ */
/* Viewer (frontend override for plugin styles)                        */
/* ------------------------------------------------------------------ */

.tla-viewer-wrap {
    margin-left: 0;
    padding: 24px;
    min-height: calc(100vh - 110px);
}

/* ------------------------------------------------------------------ */
/* 404 Page                                                            */
/* ------------------------------------------------------------------ */

.tp-404 {
    min-height: calc(100vh - 110px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.tp-404 h1 {
    font-size: 6rem;
    color: var(--tp-accent);
    line-height: 1;
}

.tp-404 p {
    color: var(--tp-text-dim);
    margin: 16px 0 24px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
    .tp-vehicle-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tp-hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .tp-hero-text p {
        max-width: 100%;
    }

    .tp-hero-buttons {
        justify-content: center;
    }

    .tp-hero-text h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .tp-hamburger {
        display: flex;
    }

    .tp-nav-links {
        display: none;
    }

    .tp-vehicle-grid {
        grid-template-columns: 1fr;
    }

    .tp-features-grid {
        grid-template-columns: 1fr;
    }

    .tp-showcase-grid {
        grid-template-columns: 1fr;
    }

    .tp-stats-inner {
        flex-direction: column;
        gap: 24px;
    }

    .tp-stat + .tp-stat {
        border-left: none;
        border-top: 1px solid var(--tp-border);
        padding-top: 24px;
    }

    .tp-how-steps {
        flex-direction: column;
        align-items: center;
    }

    .tp-how-arrow {
        transform: rotate(90deg);
    }

    .tp-hero-image {
        display: none;
    }

    .tp-hero-text h1 {
        font-size: 1.8rem;
    }

    .tp-footer-inner {
        flex-direction: column;
        gap: 16px;
    }

    .tp-add-vehicle-form .tp-form-row {
        flex-direction: column;
    }
}

/* ------------------------------------------------------------------ */
/* Share panel                                                         */
/* ------------------------------------------------------------------ */

.tp-share-panel {
    display: none;
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.15);
}
.tp-share-panel.open { display: block; }
.tp-share-section { margin-bottom: 20px; }
.tp-share-section:last-child { margin-bottom: 0; }
.tp-share-section h4 {
    font-size: 0.85rem; color: var(--tp-text-dim); margin: 0 0 10px 0;
    text-transform: uppercase; letter-spacing: 0.05em;
    display: flex; align-items: center; gap: 6px;
}
.tp-share-meta { color: var(--tp-text-dim); font-size: 0.8rem; }
.tp-share-email { font-weight: 500; font-size: 0.85rem; }

/* Share item card */
.tp-share-item {
    padding: 8px 10px; margin-bottom: 8px; border-radius: 6px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
}
.tp-share-item-header {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.tp-share-item-details {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

/* Share item actions group */
.tp-share-item-actions {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.tp-share-item-actions .tp-revoke-form { display: inline; }

/* Edit share form */
.tp-share-edit-form {
    display: none; margin-top: 8px; padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.tp-share-edit-form.open { display: block; }

/* URL row with inline copy icon */
.tp-share-url-row {
    display: flex; align-items: center; margin-top: 6px;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 4px;
    background: rgba(0,0,0,0.2); overflow: hidden;
}
.tp-share-url-row .tp-share-url-input {
    flex: 1; border: none; background: transparent; color: var(--tp-text);
    font-size: 0.78rem; padding: 5px 8px; outline: none; min-width: 0;
    font-family: monospace;
}
.tp-copy-btn {
    background: none; border: none; border-left: 1px solid rgba(255,255,255,0.1);
    color: var(--tp-text-dim); cursor: pointer; padding: 5px 10px;
    font-size: 0.9rem; transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.tp-copy-btn:hover { color: var(--tp-accent); background: rgba(255,255,255,0.05); }
.tp-copy-btn.tp-copied { color: #22c55e; }

/* Create form */
.tp-share-create-form { margin-top: 8px; }

/* Log selection toggle */
.tp-link-btn {
    background: none; border: none; color: var(--tp-accent); cursor: pointer;
    font-size: 0.8rem; padding: 0; margin-bottom: 6px; text-decoration: underline;
    text-underline-offset: 2px;
}
.tp-link-btn:hover { opacity: 0.8; }
.tp-share-log-select { margin-bottom: 8px; }
.tp-log-checkboxes {
    display: none; margin-left: 4px; padding: 6px 0;
}
.tp-log-checkboxes.open { display: block; }
.tp-log-checkbox {
    display: block; margin-bottom: 3px; font-size: 0.82rem; cursor: pointer;
}

/* Tooltip */
.tp-tooltip {
    position: relative; cursor: help; color: var(--tp-text-dim);
    font-size: 0.8rem; font-weight: 400; text-transform: none; letter-spacing: 0;
}
.tp-tooltip-text {
    display: none; position: absolute; left: 50%; transform: translateX(-50%);
    top: calc(100% + 6px); z-index: 100; width: 240px; padding: 8px 10px;
    background: var(--tp-surface, #1e1e2e); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px; font-size: 0.78rem; line-height: 1.4; color: var(--tp-text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4); text-align: left;
}
.tp-tooltip:hover .tp-tooltip-text,
.tp-tooltip:focus .tp-tooltip-text { display: block; }

/* Badges */
.tp-badge { font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; text-transform: uppercase; }
.tp-badge-active { background: rgba(34,197,94,0.15); color: #22c55e; }
.tp-badge-pending { background: rgba(250,204,21,0.15); color: #facc15; }

/* ------------------------------------------------------------------ */
/* Legal pages (Terms, Privacy)                                        */
/* ------------------------------------------------------------------ */

.tp-legal {
    padding: 60px 0 80px;
    min-height: 60vh;
}
.tp-legal h1 {
    font-size: 2rem; margin-bottom: 4px;
}
.tp-legal-effective {
    color: var(--tp-text-dim); font-size: 0.85rem; margin-bottom: 32px;
}
.tp-legal h2 {
    font-size: 1.15rem; margin: 32px 0 10px; padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.tp-legal h3 {
    font-size: 0.95rem; margin: 18px 0 8px; color: var(--tp-text-dim);
}
.tp-legal p {
    font-size: 0.9rem; line-height: 1.7; margin-bottom: 12px; color: var(--tp-text);
    max-width: 72ch;
}
.tp-legal ul {
    margin: 0 0 16px 20px; padding: 0;
}
.tp-legal ul li {
    font-size: 0.9rem; line-height: 1.7; margin-bottom: 6px; color: var(--tp-text);
    max-width: 72ch;
}
.tp-legal a {
    color: var(--tp-accent); text-decoration: underline; text-underline-offset: 2px;
}
.tp-legal a:hover { opacity: 0.8; }
.tp-legal code {
    background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 3px;
    font-size: 0.85em;
}

/* ------------------------------------------------------------------ */
/* FAQ page                                                            */
/* ------------------------------------------------------------------ */

.tp-faq-group {
    margin-bottom: 8px;
}
.tp-faq-item {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--tp-surface);
    overflow: hidden;
}
.tp-faq-question {
    padding: 14px 18px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--tp-text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background 0.15s;
}
.tp-faq-question:hover {
    background: rgba(255,255,255,0.03);
}
.tp-faq-question::-webkit-details-marker {
    display: none;
}
.tp-faq-question::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--tp-text-dim);
    flex-shrink: 0;
    transition: transform 0.2s;
}
.tp-faq-item[open] > .tp-faq-question::after {
    content: '\2212';
}
.tp-faq-answer {
    padding: 0 18px 14px;
}
.tp-faq-answer p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--tp-text-dim);
    margin: 0;
    max-width: 72ch;
}
.tp-faq-answer a {
    color: var(--tp-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.tp-faq-answer a:hover { opacity: 0.8; }

/* ------------------------------------------------------------------ */
/* Contact page                                                        */
/* ------------------------------------------------------------------ */

.tp-contact-form {
    max-width: 560px;
    margin: 32px 0 24px;
}
.tp-cf7-row {
    margin-bottom: 16px;
}
.tp-cf7-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.tp-cf7-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--tp-text-dim);
    margin-bottom: 6px;
}
.tp-optional {
    font-weight: 400;
    color: var(--tp-text-dim);
    opacity: 0.6;
}
.tp-contact-form input[type="text"],
.tp-contact-form input[type="email"],
.tp-contact-form input[type="tel"],
.tp-contact-form textarea {
    width: 100%;
    background: var(--tp-surface);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--tp-text);
    transition: border-color 0.15s;
}
.tp-contact-form input:focus,
.tp-contact-form textarea:focus {
    outline: none;
    border-color: var(--tp-accent);
}
.tp-contact-form textarea {
    min-height: 140px;
    resize: vertical;
}
.tp-contact-form input[type="submit"] {
    background: var(--tp-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.tp-contact-form input[type="submit"]:hover {
    opacity: 0.9;
}
.tp-contact-note {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    max-width: 560px;
}
.tp-contact-note p {
    font-size: 0.82rem;
    color: var(--tp-text-dim);
}
.wpcf7-response-output {
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin: 16px 0 0 !important;
}
.wpcf7-not-valid-tip {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 4px;
}
@media (max-width: 600px) {
    .tp-cf7-row-half {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------ */
/* Settings page                                                       */
/* ------------------------------------------------------------------ */

.tp-settings {
    padding: 60px 0 80px;
    min-height: 60vh;
}
.tp-settings h1 {
    font-size: 1.5rem; margin-bottom: 20px;
}
.tp-settings-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 768px) {
    .tp-settings-grid { grid-template-columns: 1fr; }
}
.tp-settings-card {
    background: var(--tp-surface); border: 1px solid var(--tp-border);
    border-radius: 10px; padding: 24px;
}
.tp-settings-card h2 {
    font-size: 1.05rem; margin: 0 0 16px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tp-settings-field { margin-bottom: 14px; }
.tp-settings-hint {
    font-size: 0.78rem; color: var(--tp-text-dim); margin: 4px 0 0;
}
.tp-input-readonly {
    opacity: 0.6; cursor: not-allowed;
}
.tp-settings-footer {
    margin-top: 24px;
}
.tp-settings-footer a {
    color: var(--tp-text-dim); font-size: 0.85rem;
}
.tp-settings-footer a:hover { color: var(--tp-text); }
.tp-alert-success {
    background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.25);
    color: #22c55e; padding: 10px 14px; border-radius: 6px;
    font-size: 0.85rem; margin-bottom: 16px;
}

/* Tooltip badge (data-tip variant for settings page) */
.tp-tooltip[data-tip] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tp-border, #2a2a4a);
    color: var(--tp-text-dim, #8888aa);
    font-size: 10px;
    cursor: help;
    position: relative;
    margin-left: 4px;
    vertical-align: middle;
}

.tp-tooltip[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #ccc;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    width: 280px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 100;
    font-weight: 400;
}

.tp-tooltip[data-tip]:hover::after,
.tp-tooltip[data-tip]:focus::after {
    opacity: 1;
}

/* AI settings extras */
.tp-settings-card-wide {
    grid-column: 1 / -1;
}

.tp-radio-group {
    display: flex;
    gap: 20px;
}

.tp-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--tp-text, #e0e0e0);
    cursor: pointer;
}

.tp-channel-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 4px 16px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
}

.tp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--tp-text-dim, #8888aa);
    font-size: 13px;
    cursor: pointer;
}
