/**
 * Profile Page Styles
 * Extending the main TravelMate design system
 */

/* Checkbox Styles */
.checkbox-container {
    margin: 1rem 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checkbox-text strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.checkbox-text small {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--primary-color);
}

/* Location Display */
.location-display {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.location-display i {
    color: var(--primary-color);
}

.location-display strong {
    color: var(--text-primary);
    font-family: monospace;
}

/* Section Subtitle */
.section-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0.5rem 0 0 0;
    font-style: italic;
}

/* Profile Main Layout */
.profile-main {
    padding-top: 5rem; /* Account for fixed navbar */
    min-height: 100vh;
    background: var(--bg-secondary);
}

.profile-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Profile Header */
.profile-header {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
}

/* Avatar Section */
.avatar-section {
    position: relative;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.avatar,
.avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: contain;
    object-position: center;
    border: 4px solid var(--border-light);
    background: var(--bg-primary);
}

.avatar-placeholder {
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.avatar-edit-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Profile Info */
.profile-info {
    min-width: 0; /* Prevent flex item from overflowing */
}

.profile-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0 0 1rem 0;
}

.profile-bio {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bio-text {
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
    flex: 1;
}

/* Profile Stats */
.profile-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    min-width: 80px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Profile Grid Layout */
.profile-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.profile-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header i {
    color: var(--primary-color);
}

/* Mini Map */
.mini-map-container {
    position: relative;
    height: 300px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
}

.mini-map {
    width: 100%;
    height: 100%;
}

.map-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

/* Places List */
.places-list {
    max-height: 400px;
    overflow-y: auto;
}

.place-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    transition: var(--transition);
    cursor: pointer;
}

.place-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.place-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.place-info {
    flex: 1;
    min-width: 0;
}

.place-name {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.place-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.place-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Countries Grid */
.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.country-item {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-primary);
}

.country-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.country-item:hover .country-flag {
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.country-flag {
    width: 48px;
    height: 36px;
    display: block;
    margin: 0 auto 0.5rem auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.country-flag[src] {
    background: transparent;
}

.country-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.country-item.visited {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.country-item.visited .country-flag {
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 0 2px white, 0 2px 8px rgba(0,0,0,0.15);
}

.country-item.visited .country-name {
    color: white;
}

.country-item.visited {
    position: relative;
}

.country-item.visited .remove-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.country-item.visited:hover .remove-indicator {
    opacity: 1;
}

/* Countries Selection Modal */
.countries-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 1rem;
}

.country-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-primary);
}

.country-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.country-option.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.country-option .country-flag {
    width: 32px;
    height: 24px;
    margin: 0;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    background-size: 200% 200%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.country-option .country-flag[src] {
    animation: none;
    background: transparent;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.country-option:hover .country-flag {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.country-option.selected .country-flag {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary-color);
}

.country-option .country-name {
    font-size: 0.875rem;
    margin: 0;
    font-weight: 500;
}

.country-option.selected .country-name {
    color: white;
}

/* Search Box */
.search-box {
    margin-bottom: 1rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

/* Form Enhancements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-lg {
    max-width: 600px;
}

/* Avatar Upload Component */
.avatar-upload-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.current-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-avatar img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.current-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 2rem;
}

.avatar-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.form-help {
    margin-top: 0.5rem;
}

.form-help small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Loading states for file upload */
.avatar-upload-container.uploading {
    opacity: 0.7;
    pointer-events: none;
}

.avatar-upload-container.uploading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Active nav link */
.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .profile-container {
        padding: 1rem;
    }

    .profile-header {
        padding: 1.5rem;
    }

    .profile-stats {
        gap: 1rem;
    }

    .stat-item {
        min-width: 60px;
        padding: 0.75rem;
    }

    .countries-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .countries-selection {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Place Cards */
.place-item-enhanced {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-primary);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.place-item-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.place-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.place-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.place-item-enhanced:hover .place-image img {
    transform: scale(1.05);
}

.image-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.place-content {
    padding: 1.25rem;
}

.place-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.place-icon {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
    flex-shrink: 0;
}

.place-title {
    flex: 1;
    min-width: 0;
}

.place-name {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.place-category {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.place-description {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.5;
    margin: 0 0 1rem 0;
}

.place-website {
    margin-bottom: 1rem;
}

.place-website a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.place-website a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.place-custom-fields {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.custom-field {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.custom-field:last-child {
    margin-bottom: 0;
}

.custom-field strong {
    color: var(--text-primary);
    font-weight: 600;
}

.place-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.place-coordinates {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.place-coordinates i {
    color: var(--primary-color);
}

.place-public-badge,
.place-private-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.place-public-badge {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.place-private-badge {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.place-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

/* Popup Styles for Map */
.public-place-popup .place-actions {
    margin-top: 1rem;
    gap: 0.5rem;
}

.public-place-popup .btn-sm {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.public-place-popup .place-actions .btn {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.public-place-popup .place-image img {
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.public-place-popup .custom-fields {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.public-place-popup .custom-fields h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.public-place-popup .custom-field {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

/* Responsive adjustments for enhanced cards */
@media (max-width: 768px) {
    .place-item-enhanced {
        margin-bottom: 0.75rem;
    }

    .place-content {
        padding: 1rem;
    }

    .place-header {
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .place-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .place-name {
        font-size: 1rem;
    }

    .place-image {
        height: 160px;
    }
}
/* ===== My Routes ===== */
.my-routes-section { grid-column: 1 / -1; }
.my-routes-list { display: flex; flex-direction: column; gap: 0.6rem; }
.my-route { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.75rem 1rem; }
.my-route:hover { border-color: #a5b4fc; }
.my-route-main { min-width: 0; }
.my-route-desc { font-size: 0.85rem; color: var(--text-secondary); }
.my-route-stops { font-size: 0.85rem; color: var(--text-secondary); margin: 0.2rem 0; }
.my-route-main small { color: var(--text-muted); }
.my-route-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.my-route-actions a { text-decoration: none; }

/* ===== My Trips page ===== */
.trips-page { max-width: 1100px; margin: 0 auto; }
.trips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.trip-card { border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1rem; display: flex; flex-direction: column; gap: 0.35rem; background: var(--bg-primary); }
.trip-card:hover { border-color: #a5b4fc; box-shadow: var(--shadow-md); }
.trip-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.trip-top h3 { margin: 0; font-size: 1.05rem; }
.trip-dates { color: #4338ca; font-weight: 600; font-size: 0.85rem; }
.trip-dates .muted { color: var(--text-muted); font-weight: 400; }
.trip-stats { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.85rem; color: var(--text-secondary); }
.trip-sleep, .trip-chain, .trip-desc { font-size: 0.8rem; color: var(--text-secondary); }
.trip-chain { color: var(--text-muted); }
.trip-actions { display: flex; gap: 0.4rem; margin-top: 0.4rem; }
.trip-actions a { text-decoration: none; }

.trip-ok { color: #059669; }

/* ===== trip page ===== */
.trip-page { max-width: 1200px; margin: 0 auto; padding: 0 1rem 2rem; }
.trip-head-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: 1rem 0 0.75rem; flex-wrap: wrap; }
.trip-head-bar h1 { margin: 0.2rem 0; font-size: 1.6rem; }
.trip-back { font-size: 0.85rem; color: var(--text-muted, #6b7280); text-decoration: none; }
.trip-meta { color: var(--text-secondary, #4b5563); font-size: 0.9rem; }
.trip-head-actions { display: flex; align-items: center; gap: 0.75rem; }
.trip-head-actions a { text-decoration: none; }
.save-state { font-size: 0.8rem; color: var(--text-muted, #6b7280); }
.save-state.unsaved { color: #b45309; } .save-state.saved { color: #059669; } .save-state.error { color: #b91c1c; }
.trip-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border-color); margin-bottom: 1rem; overflow-x: auto; }
.trip-tab { border: none; background: none; padding: 0.6rem 1rem; font-size: 0.95rem; cursor: pointer; border-bottom: 3px solid transparent; color: var(--text-secondary, #4b5563); white-space: nowrap; }
.trip-tab.active { border-bottom-color: #6366f1; color: #4338ca; font-weight: 600; }
.trip-panel { background: #fff; border-radius: 12px; padding: 1rem 1.25rem; box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08)); }
.trip-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 0.6rem 1rem; border-radius: 8px; background: #111827; color: #fff; z-index: 3000; display: none; font-size: 0.9rem; }
.trip-toast.error { background: #b91c1c; } .trip-toast.success { background: #059669; }
.days-view { display: flex; flex-direction: column; gap: 1rem; }
.dv-day { border: 1px solid var(--border-color); border-radius: 10px; padding: 0.75rem 1rem; }
.dv-day-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; margin-bottom: 0.5rem; }
.dv-date { font-weight: 700; color: #4338ca; }
.dv-route { font-weight: 600; }
.dv-stats { margin-left: auto; color: var(--text-secondary, #4b5563); font-size: 0.85rem; }
.dv-leg { margin-left: 0.9rem; padding: 0.2rem 0 0.2rem 0.9rem; border-left: 2px dashed #c7d2fe; font-size: 0.85rem; color: var(--text-secondary, #4b5563); }
.dv-onway { margin: 0.2rem 0 0 0; padding-left: 1rem; color: #0f766e; }
.dv-stop-head { font-size: 0.95rem; }
.dv-stop-head small { color: var(--text-muted, #9ca3af); }
.dv-spots { margin: 0.1rem 0 0.3rem 1.6rem; padding-left: 1rem; font-size: 0.85rem; }
.dv-spots li::marker { content: '★ '; color: #f59e0b; }
.dv-onway li::marker { content: '◆ '; }
.dv-lodging { margin: 0.2rem 0 0 1.6rem; font-size: 0.85rem; background: #f5f3ff; border-radius: 6px; padding: 0.3rem 0.5rem; }
.dv-free { margin-top: 0.2rem; color: #0369a1; }
.car-cols { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.car-col { flex: 1 1 320px; } .car-col.wide { flex: 2 1 480px; }
.car-col h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.car-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px dashed #e5e7eb; }
.car-label { flex: 1; }
.car-form { background: #f9fafb; border-radius: 8px; padding: 0.6rem; margin-top: 0.4rem; }
.car-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0.6rem; font-size: 0.8rem; margin-bottom: 0.5rem; }
.car-grid label { display: flex; flex-direction: column; gap: 0.15rem; }
.car-grid small { color: var(--text-muted, #6b7280); }
.car-notes { grid-column: 1 / -1; }
.fuel-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.fuel-table th { text-align: left; color: var(--text-muted, #6b7280); font-weight: 500; border-bottom: 1px solid var(--border-color); padding: 0.3rem 0.4rem; }
.fuel-table td { padding: 0.3rem 0.4rem; border-bottom: 1px dashed #e5e7eb; }
.fuel-table .tb-total td { font-weight: 700; border-bottom: none; }
.fuel-manual { display: inline-flex; gap: 0.25rem; align-items: center; }
.trip-panel .tb { border: none; background: none; padding: 0; font-size: 0.9rem; }

.rf-sum { margin: 0.4rem 0; font-size: 0.9rem; }
.rf-save { color: #059669; font-weight: 700; }
.rf-why { font-size: 0.78rem; color: var(--text-secondary, #4b5563); }
.dv-refuel { color: #b45309; margin: 0.15rem 0 0 0.2rem; }

.dv-tools { display: flex; justify-content: flex-end; margin-bottom: 0.4rem; }
.rn-box { border: 1px solid #c7d2fe; background: #f5f7ff; border-radius: 8px; padding: 0.6rem 0.8rem; margin-bottom: 0.8rem; font-size: 0.85rem; }
.rn-row { display: flex; gap: 0.4rem; align-items: baseline; padding: 0.15rem 0; }
.rn-old { color: var(--text-muted, #6b7280); }

/* weather in the Days tab */
.dv-wx { margin-left: 8px; font-size: 0.85rem; color: #374151; }
.dv-wx .wx-usual { color: #6b7280; }
.dv-wx-attr { margin-top: 10px; font-size: 0.75rem; color: var(--text-muted, #9ca3af); }
.dv-wx-attr a { color: inherit; }
