/* Cruisy Club PWA - Mobile-first, theme variables */
:root {
    --bg-page: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-input: #252525;
    --text: #e8e8e8;
    --text-muted: #888;
    --accent: #e67e22;
    --accent-hover: #d35400;
    --border: #333;
    --success: #27ae60;
    --error: #c0392b;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.theme-light {
    --bg-page: #f5f5f5;
    --bg-card: #fff;
    --bg-input: #fff;
    --text: #222;
    --text-muted: #666;
    --border: #ddd;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; background: var(--bg-page) url('/assets/background.png') no-repeat center center fixed; background-size: cover; color: var(--text); line-height: 1.5; min-height: 100vh; }

.site-header {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    padding: 0.5rem 1rem; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; display: inline-flex; align-items: center; gap: 0.5rem; }
.brand-logo { height: 32px; width: auto; max-width: 120px; object-fit: contain; vertical-align: middle; }

.nav-bar { display: flex; align-items: center; gap: 0.25rem; }
.nav-icon { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.35rem 0.6rem; color: var(--text-muted); text-decoration: none; font-size: 0.75rem; border-radius: var(--radius); min-width: 2.5rem; }
.nav-icon:hover { color: var(--accent); background: var(--bg-input); }
.nav-icon-symbol { font-size: 1.25rem; line-height: 1.2; }
.nav-icon-label { font-size: 0.65rem; }
@media (min-width: 480px) {
    .nav-icon { padding: 0.4rem 0.75rem; }
    .nav-icon-label { font-size: 0.7rem; }
}

.nav-menu-wrap { position: relative; margin-left: 0.25rem; }
.nav-menu-dropdown { position: relative; }
.nav-menu-trigger { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0.35rem 0.6rem; color: var(--text-muted); border-radius: var(--radius); font-size: 1.25rem; }
.nav-menu-trigger::-webkit-details-marker { display: none; }
.nav-menu-trigger:hover { color: var(--accent); background: var(--bg-input); }
.nav-dropdown { position: absolute; top: 100%; right: 0; margin-top: 0.25rem; min-width: 180px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.5rem 0; z-index: 100; }
.nav-dropdown a, .nav-dropdown .nav-dropdown-btn { display: block; width: 100%; padding: 0.5rem 1rem; text-align: left; color: var(--text); text-decoration: none; font-size: 0.9rem; background: none; border: none; cursor: pointer; font-family: inherit; }
.nav-dropdown a:hover, .nav-dropdown .nav-dropdown-btn:hover { background: var(--bg-input); color: var(--accent); }
.nav-dropdown-logout { border-top: 1px solid var(--border); margin-top: 0.25rem; padding-top: 0.5rem; color: var(--text-muted) !important; }
.nav-main { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.nav-main a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.nav-main a:hover { color: var(--accent); }

.main-content { padding: 1rem; max-width: 960px; margin: 0 auto; }
.site-footer { padding: 1rem; text-align: center; font-size: 0.85rem; color: var(--text-muted); border-top: 1px solid var(--border); }
.site-footer a { color: var(--text-muted); }

.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: var(--radius); text-decoration: none; font-size: 0.95rem; cursor: pointer; border: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: 0.25rem; }
.btn-danger { background: var(--error); color: #fff; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; max-width: 360px; padding: 0.5rem 0.75rem;
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-size: 1rem;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.current-logo { margin: 0.5rem 0; }
.checkbox-label { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: normal; }

.profile-header { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.profile-heading h1 { margin: 0 0 0.25rem 0; }
.profile-meta { font-size: 0.9rem; color: var(--text-muted); margin: 0.25rem 0; }
.profile-roles { font-size: 0.9rem; margin: 0.25rem 0; }
.profile-links { list-style: none; padding: 0; margin: 0; }
.profile-links li { margin: 0.25rem 0; }
.vehicle-card { display: flex; gap: 1rem; margin: 1rem 0; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.vehicle-card:last-child { border-bottom: none; }
.vehicle-photo { width: 120px; height: 80px; object-fit: cover; border-radius: var(--radius); }
.social-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.social-row input[type="text"] { width: 100px; max-width: none; }
.social-row input[type="url"] { flex: 1; min-width: 150px; }
.vehicle-list { list-style: none; padding: 0; margin: 0 0 1rem 0; }
.vehicle-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.vehicle-item:last-child { border-bottom: none; }
.vehicle-thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 4px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.feed-compose { margin-bottom: 1.5rem; }
.feed-compose-form { padding: 0; }
.feed-compose-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: nowrap; }
.feed-compose-avatar { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--bg-input); display: flex; align-items: center; justify-content: center; }
.feed-compose-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.feed-compose-avatar-initial { font-size: 1.25rem; font-weight: 600; color: var(--text-muted); }
.feed-compose-input-wrap { flex: 1; min-width: 0; }
.feed-compose-input-wrap textarea { width: 100%; padding: 0.5rem 0.6rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 1rem; font-family: inherit; resize: none; min-height: 38px; }
.feed-compose-input-wrap textarea::placeholder { color: var(--text-muted); }
.feed-compose-input-wrap textarea:focus { outline: none; border-color: var(--accent); }
.feed-compose-actions { display: flex; align-items: center; gap: 0.15rem; flex-shrink: 0; position: relative; }
.feed-compose-action { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: none; background: none; color: var(--text-muted); cursor: pointer; border-radius: var(--radius); font-size: 1.2rem; }
.feed-compose-action:hover { color: var(--accent); background: var(--bg-input); }
.feed-compose-icon-photo { width: 20px; height: 20px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E") center/contain no-repeat; }
.feed-compose-icon-emoji { line-height: 1; }
.feed-compose-submit { flex-shrink: 0; }
.feed-compose-submit .btn { padding: 0.45rem 0.85rem; font-size: 0.9rem; }
.feed-emoji-picker { position: absolute; left: 0; bottom: 100%; margin-bottom: 0.25rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.5rem; z-index: 50; max-height: 180px; overflow-y: auto; }
.feed-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.25rem; }
.feed-emoji-grid button { width: 32px; height: 32px; padding: 0; border: none; background: none; cursor: pointer; font-size: 1.25rem; border-radius: 4px; }
.feed-emoji-grid button:hover { background: var(--bg-input); }

.feed-post { margin-bottom: 1rem; }
.post-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; margin-bottom: 0.5rem; font-size: 0.9rem; }
.post-author { font-weight: 600; }
.author-badge { display: inline-flex; margin-left: 0.25rem; vertical-align: middle; cursor: help; }
.author-badge-admin { color: #e53935; }
.author-badge-moderator { color: #fb8c00; }
.post-time { color: var(--text-muted); }
.post-delete-form { margin-left: auto; }
.post-delete-form .btn-delete, .comment-delete-form .btn-delete { font-size: 0.85rem; color: var(--text-muted); padding: 0.2rem 0.5rem; }
.post-delete-form .btn-delete:hover, .comment-delete-form .btn-delete:hover { color: var(--error); }
.post-body { margin: 0.5rem 0; }
.post-body .feed-video-embed { margin: 0.5rem 0; max-width: 100%; border-radius: var(--radius); position: relative; height: 0; padding-bottom: 56.25%; overflow: hidden; }
.post-body .feed-video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.post-image img { max-width: 100%; max-height: 400px; border-radius: var(--radius); }
.post-actions { display: flex; align-items: center; gap: 0.25rem 0.75rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.post-action-form { margin: 0; }
.post-action-btn { display: inline-flex; align-items: center; padding: 0.25rem; color: var(--text-muted); }
.post-action-btn:hover { color: var(--accent); }
.post-action-like:has(.bi-hand-thumbs-up-fill) { color: var(--accent); }
.post-action-like:has(.bi-hand-thumbs-up-fill):hover { color: var(--accent-hover); }
.post-action-love:has(.bi-arrow-through-heart-fill) { color: #e91e63; }
.post-action-love:has(.bi-arrow-through-heart-fill):hover { color: #c2185b; }
.post-action-dislike:has(.bi-hand-thumbs-down-fill) { color: var(--text-muted); }
.post-action-dislike:has(.bi-hand-thumbs-down-fill):hover { color: var(--error); }
.post-action-btn .bi { font-size: 1.15rem; }
.post-action-count { font-size: 0.9rem; color: var(--text-muted); margin-right: 0.25rem; }
.post-comments { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.comment { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; margin-bottom: 0.5rem; font-size: 0.95rem; }
.comment-time { font-size: 0.85rem; color: var(--text-muted); }
.comment-delete-form { margin-left: auto; }
.comment p { width: 100%; margin: 0.25rem 0 0 0; }
.comment-form { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.comment-form input { flex: 1; max-width: none; }

.chat-container { display: flex; flex-direction: column; max-height: 70vh; }
.chat-messages { flex: 1; overflow-y: auto; min-height: 200px; max-height: 500px; padding: 0.5rem 0; }
.chat-msg { margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.chat-msg-time { font-size: 0.8rem; color: var(--text-muted); margin-left: 0.5rem; }
.chat-form { display: flex; gap: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); margin-top: 0.5rem; }
.chat-form input { flex: 1; max-width: none; }

.friend-list { list-style: none; padding: 0; margin: 0; }
.friend-list li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.friend-list li:last-child { border-bottom: none; }
.friend-list .inline-form { display: inline; }
.conversation-list { list-style: none; padding: 0; margin: 0; }
.conversation-item { border-bottom: 1px solid var(--border); }
.conversation-item a { display: block; padding: 0.75rem; text-decoration: none; color: var(--text); }
.conversation-item a:hover { background: var(--bg-input); }
.last-preview { display: block; font-size: 0.9rem; color: var(--text-muted); font-weight: normal; }
.last-time { font-size: 0.8rem; color: var(--text-muted); }
.dm-msg { margin-bottom: 0.5rem; }
.dm-msg.own p { background: var(--bg-input); padding: 0.25rem 0.5rem; border-radius: var(--radius); display: inline-block; }

.onboarding-page { max-width: 480px; margin: 0 auto; padding: 1.5rem 1rem; }
.onboarding-progress { position: relative; height: 6px; background: var(--border); border-radius: 3px; margin-bottom: 1.5rem; overflow: hidden; }
.onboarding-progress-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.2s; }
.onboarding-progress-text { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }
.onboarding-card h1 { margin-top: 0; font-size: 1.5rem; }
.onboarding-intro { color: var(--text-muted); margin-bottom: 1.25rem; }
.onboarding-done p { margin: 0.75rem 0; }
.onboarding-has-ride { font-weight: 600; margin-bottom: 0.5rem; }

.page-simple { padding: 2rem 1rem; text-align: center; }
.page-simple.hero h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.page-simple p { color: var(--text-muted); margin: 0.5rem 0; }
.page-simple a { color: var(--accent); }

.card { background: var(--bg-card); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; border: 1px solid var(--border); box-shadow: var(--shadow); }
.card h2, .card h3 { margin-top: 0; font-size: 1.1rem; }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-error { background: rgba(192,57,43,0.2); border: 1px solid var(--error); color: #fcc; }
.theme-light .alert-error { color: #c0392b; }
.alert-success { background: rgba(39,174,96,0.2); border: 1px solid var(--success); }

.shop-page { margin-bottom: 1.5rem; }
.shop-grid { margin-top: 1rem; }
.shop-product-card { text-decoration: none; color: var(--text); display: block; overflow: hidden; }
.shop-product-card:hover { border-color: var(--accent); }
.shop-product-image { aspect-ratio: 1; background: var(--bg-input); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.shop-product-image img { width: 100%; height: 100%; object-fit: cover; }
.shop-product-placeholder { font-size: 3rem; color: var(--text-muted); }
.shop-product-price { font-weight: 600; color: var(--accent); margin: 0.25rem 0 0 0; }
.shop-product-detail-row { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.shop-product-detail-image { flex: 0 0 200px; max-width: 100%; }
.shop-product-detail-image img { width: 100%; height: auto; border-radius: var(--radius); }
.shop-product-detail-info { flex: 1; min-width: 200px; }
.shop-product-description { margin: 0.5rem 0; color: var(--text-muted); }
#paypal-button-container { margin-top: 1rem; max-width: 250px; }

.grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

#map { height: 320px; width: 100%; border-radius: var(--radius); background: var(--bg-input); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
.table .inline-form { display: inline; }
.table .btn-link { padding: 0; font-size: inherit; text-decoration: underline; color: var(--text-muted); }
.table .btn-link:hover { color: var(--error); }
.table th { font-weight: 600; }

.waypoint-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.waypoint-row select { width: auto; min-width: 100px; }
.waypoint-row input[type="text"] { width: 80px; max-width: none; }
.waypoint-row input[name="waypoint_notes[]"] { flex: 1; min-width: 100px; }

.auth-form .form-group input { max-width: 100%; }
.card-list { list-style: none; padding: 0; margin: 0; }
.card-list li { margin-bottom: 0.5rem; }
.text-muted { color: var(--text-muted); }
