/* Mobile-first styles for Deuce & A Half */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #222;
    background: #f4f4f4;
}

.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
}

a { color: #2c5282; text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
    background: #2d3748;
    color: #fff;
    padding: 12px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.user-label {
    font-size: 0.9rem;
    opacity: 0.85;
}

.site-nav {
    background: #4a5568;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-inner {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    white-space: nowrap;
}

.site-nav a {
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    text-decoration: none;
}

.site-nav a:hover {
    background: rgba(255,255,255,0.15);
    text-decoration: none;
}

.main-content {
    padding: 20px 16px 40px;
}

.site-footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.85rem;
}

/* Landing / login */
.landing {
    text-align: center;
    padding-top: 12px;
}

.truck-photo {
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto 20px;
    display: block;
    background: #cbd5e0;
    min-height: 180px;
    object-fit: cover;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    margin-bottom: 16px;
}

.card h1, .card h2 {
    margin-top: 0;
    font-size: 1.25rem;
}

.form-group {
    margin-bottom: 14px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px; /* prevents iOS zoom */
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #2b6cb0;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #2c5282;
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.btn-danger {
    background: #c53030;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    width: auto;
}

.form-links {
    margin-top: 12px;
    font-size: 0.9rem;
    text-align: center;
}

.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
}

.alert-warning {
    background: #fefcbf;
    color: #744210;
}

.error-list {
    margin: 0;
    padding-left: 18px;
}

.module-grid {
    display: grid;
    gap: 12px;
}

.module-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.module-card h3 {
    margin: 0 0 6px;
}

.module-card.disabled {
    opacity: 0.6;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #edf2f7;
    color: #4a5568;
}

.badge-joint { background: #bee3f8; color: #2a4365; }
.badge-solo { background: #feebc8; color: #744210; }

.list-item {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.list-item h4 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.meta {
    font-size: 0.85rem;
    color: #666;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.rating-stars input {
    width: auto;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.coming-soon {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.secure-viewer {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.secure-viewer img,
.secure-viewer video {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.privacy-notice {
    font-size: 0.85rem;
    color: #744210;
    background: #fefcbf;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.msg-section {
    margin-bottom: 12px;
}

.msg-section h2 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.msg-empty {
    margin: 0 0 8px;
}

.msg-list {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    margin-bottom: 8px;
    overflow: hidden;
}

.msg-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.85rem;
    line-height: 1.3;
    min-height: 32px;
}

.msg-row:last-child {
    border-bottom: none;
}

.msg-preview {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.msg-delete-form {
    display: inline;
    margin: 0;
}

.msg-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    text-decoration: none;
}

.msg-icon-btn:hover {
    background: #edf2f7;
    color: #2b6cb0;
    text-decoration: none;
}

.msg-icon-danger:hover {
    background: #fed7d7;
    color: #c53030;
}

.msg-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.view-once-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-right: 6px;
}

.view-once-label input {
    width: auto;
    margin: 0;
}

.help-q {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #a0aec0;
    border-radius: 50%;
    background: #edf2f7;
    color: #2d3748;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    vertical-align: middle;
}

.help-q:hover {
    background: #bee3f8;
    border-color: #2b6cb0;
    color: #2b6cb0;
}

.help-popup {
    margin-top: 10px;
    padding: 12px 14px;
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #2a4365;
}

.help-popup p {
    margin: 8px 0;
}

.help-popup[hidden] {
    display: none;
}

#view-once-group {
    position: relative;
}

@media (min-width: 600px) {
    .btn-primary { width: auto; min-width: 140px; }
    .module-grid { grid-template-columns: 1fr 1fr; }
}
