/* ============================================================
   Onetapcampus Ride Share — Custom styles
   Primary: Lavender #B57EDC  |  Deep: #7A4CC2
   Responsive for all screen sizes (320px → 2560px)
   ============================================================ */

/* Base reset */
*, *::before, *::after { box-sizing: border-box; }

/* ── Typography scale ── */
html { font-size: 16px; }
@media (max-width: 375px)  { html { font-size: 14px; } }
@media (min-width: 768px)  { html { font-size: 15px; } }
@media (min-width: 1280px) { html { font-size: 16px; } }
@media (min-width: 1920px) { html { font-size: 17px; } }
@media (min-width: 2560px) { html { font-size: 19px; } }

/* ── Cards ── */
.card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(181, 126, 220, 0.1);
    padding: 1.25rem;
    transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 4px 20px rgba(181, 126, 220, 0.2); }

/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: #B57EDC;
    color: #fff;
    border-radius: 0.625rem;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    /* Minimum touch target */
    min-height: 44px;
}
.btn-primary:hover  { background: #7A4CC2; box-shadow: 0 4px 12px rgba(122,76,194,0.3); }
.btn-primary:active { transform: scale(0.97); }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 2px solid #B57EDC;
    color: #B57EDC;
    border-radius: 0.625rem;
    padding: 0.55rem 1.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    /* Minimum touch target */
    min-height: 44px;
}
.btn-outline:hover { background: #B57EDC; color: #fff; box-shadow: 0 4px 12px rgba(181,126,220,0.25); }

/* ── Form inputs ── */
.form-input {
    width: 100%;
    border: 1.5px solid #D9BFFF;
    border-radius: 0.625rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    background: #fff;
    color: #1F2937;
    font-family: inherit;
    /* iOS font-size fix (prevents zoom) */
    font-size: max(16px, 0.9rem);
    min-height: 44px;
}
.form-input:focus {
    border-color: #B57EDC;
    box-shadow: 0 0 0 3px rgba(181, 126, 220, 0.18);
}
.form-input::placeholder { color: #9CA3AF; }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

/* ── Badge ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge-lavender  { background: #EDE0FF; color: #7A4CC2; }
.badge-green     { background: #D1FAE5; color: #065F46; }
.badge-red       { background: #FEE2E2; color: #991B1B; }
.badge-gray      { background: #F3F4F6; color: #374151; }
.badge-yellow    { background: #FEF3C7; color: #92400E; }
.badge-blue      { background: #DBEAFE; color: #1D4ED8; }

/* ── Ride card ── */
.ride-card {
    background: #fff;
    border: 1.5px solid #EDE0FF;
    border-radius: 1rem;
    padding: 1.1rem 1.25rem;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.ride-card:hover { box-shadow: 0 4px 18px rgba(181,126,220,0.18); border-color: #B57EDC; transform: translateY(-1px); }

/* ── Hero gradient ── */
.hero-gradient {
    background: linear-gradient(135deg, #5C35A3 0%, #7A4CC2 35%, #B57EDC 75%, #D9BFFF 100%);
}

/* ── Stat card ── */
.stat-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(181,126,220,0.12);
    border: 1.5px solid #EDE0FF;
    transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 18px rgba(181,126,220,0.2); transform: translateY(-1px); }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: #7A4CC2; line-height: 1.1; }
.stat-card .stat-label { font-size: 0.78rem; color: #6B7280; margin-top: 0.25rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* ── Chat UI ── */
.chat-bubble-self  { background: #B57EDC; color: #fff; border-radius: 1.1rem 1.1rem 0.2rem 1.1rem; }
.chat-bubble-other { background: #EDE0FF; color: #1F2937; border-radius: 1.1rem 1.1rem 1.1rem 0.2rem; }
.chat-bubble {
    max-width: 78%;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}
@media (max-width: 480px) {
    .chat-bubble { max-width: 90%; font-size: 0.85rem; }
}

/* ── Notification dot ── */
.notif-dot {
    width: 0.55rem;
    height: 0.55rem;
    background: #B57EDC;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Spinner ── */
.spinner {
    width: 1.25rem; height: 1.25rem;
    border: 2.5px solid #EDE0FF;
    border-top-color: #B57EDC;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast animation ── */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(1.5rem); }
    to   { opacity: 1; transform: translateX(0); }
}
.flash-toast { animation: slideIn 0.25s ease; }

/* Flash container: responsive positioning */
#flash-container {
    max-width: min(90vw, 22rem);
}
@media (max-width: 480px) {
    #flash-container {
        top: 0.5rem !important;
        right: 0.5rem !important;
    }
}

/* ── Page container: extra bottom padding on mobile (room for bottom nav) ── */
@media (max-width: 767px) {
    .page-container { padding-bottom: 5.5rem; }
}

/* ── Table responsive wrapper ── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive table { min-width: 540px; }

/* ── Utility: truncate text ── */
.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Input group ── */
.input-group { position: relative; }
.input-group .input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #B57EDC;
    pointer-events: none;
}
.input-group .form-input { padding-left: 2.25rem; }

/* ── Divider ── */
.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #9CA3AF;
    font-size: 0.82rem;
    font-weight: 500;
    margin: 1.25rem 0;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E5E7EB;
}

/* ── Google button ── */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    border: 1.5px solid #D9BFFF;
    border-radius: 0.625rem;
    padding: 0.7rem 1rem;
    background: #fff;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
    text-decoration: none;
    min-height: 44px;
}
.btn-google:hover { background: #F7F1FF; border-color: #B57EDC; }

/* ── Focus-visible ring (accessibility) ── */
:focus-visible {
    outline: 2.5px solid #B57EDC;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* ── Smooth scroll ── */
html { scroll-behavior: smooth; }

/* ── Section headings ── */
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

/* ── Back-to-top button ── */
#back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── xs screen (320-374px) tighten up ── */
@media (max-width: 374px) {
    .btn-primary, .btn-outline { padding: 0.6rem 1rem; font-size: 0.82rem; }
    .stat-card .stat-value { font-size: 1.6rem; }
    .card { padding: 1rem; }
    .ride-card { padding: 0.9rem 1rem; }
}

/* ── sm screen (375-639px) ── */
@media (min-width: 375px) and (max-width: 639px) {
    .stat-card .stat-value { font-size: 1.8rem; }
}

/* ── Tablet (640-1023px): generous spacing ── */
@media (min-width: 640px) and (max-width: 1023px) {
    .card { padding: 1.5rem; }
    .ride-card { padding: 1.25rem 1.5rem; }
    .stat-card { padding: 1.5rem; }
    .stat-card .stat-value { font-size: 2.2rem; }
}

/* ── Large desktop (1280px+): wider cards ── */
@media (min-width: 1280px) {
    .card { padding: 1.5rem; }
    .ride-card { padding: 1.25rem 1.5rem; }
}

/* ── 4K / 2560px+ ── */
@media (min-width: 2560px) {
    .card { border-radius: 1.25rem; }
    .ride-card { border-radius: 1.25rem; }
}

/* ── Print: hide nav/footer ── */
@media print {
    header, footer, nav, #back-to-top { display: none !important; }
    .page-container { padding-bottom: 0 !important; }
    body { background: #fff !important; }
    .card, .ride-card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

