/* Customer-side styling (only applies when <body class="customer">) */
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: #eef2ff; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .6); }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; margin: 6px; }

/* Friendlier navbar */
body.customer .navbar { background: linear-gradient(90deg, #4f46e5, #7c3aed); border: 0; }
body.customer .brand, body.customer .nav-user { color: #fff; }
body.customer .nav-links a { color: rgba(255, 255, 255, .85); }
body.customer .nav-links a:hover { background: rgba(255, 255, 255, .15); color: #fff; }
body.customer .nav-user .btn-light { background: rgba(255, 255, 255, .18); color: #fff; }
body.customer .nav-user .btn-primary { background: #fff; color: var(--primary); }
body.customer .nav-user .role { background: rgba(255, 255, 255, .2); color: #fff; }

/* Hero on the customer dashboard */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
    background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border-radius: 18px; padding: 34px 38px; margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, .25); }
.hero h1 { font-size: 2rem; margin: 0 0 6px; }
.hero p { margin: 0 0 18px; opacity: .9; max-width: 460px; }
.hero .btn { margin: 0; }
.hero-stats { display: flex; gap: 14px; }
.hero-stats div { background: rgba(255, 255, 255, .15); border-radius: 14px; padding: 16px 26px; text-align: center; }
.hero-stats strong { display: block; font-size: 2rem; }
.hero-stats span { font-size: .85rem; opacity: .9; }

/* Filter tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { background: #fff; border: 1px solid var(--border); color: var(--muted); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; }
.tabs a small { background: var(--bg); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tabs a.on small { background: rgba(255, 255, 255, .25); }

/* Ticket cards */
.ticket-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.ticket-card { display: block; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px; color: var(--text); transition: .15s; }
.ticket-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(79, 70, 229, .12); border-color: #c7d2fe; }
.ticket-card h3 { margin: 10px 0 14px; font-size: 1.08rem; }
.tc-top, .tc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tc-ref { font-size: .78rem; color: var(--muted); font-weight: 600; }
.tc-foot { margin-top: 14px; font-size: .82rem; color: var(--muted); }

/* Progress tracker */
.tracker { display: flex; }
.track-step { flex: 1; text-align: center; font-size: .72rem; color: var(--muted); position: relative; }
.track-step .dot { display: flex; width: 24px; height: 24px; margin: 0 auto 4px; border-radius: 50%; background: #e2e8f0; color: #64748b;
    align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; position: relative; z-index: 1; }
.track-step::before { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #e2e8f0; }
.track-step:first-child::before { display: none; }
.track-step.done::before, .track-step.current::before { background: var(--primary); }
.track-step.done .dot { background: var(--primary); color: #fff; }
.track-step.current .dot { background: #fff; color: var(--primary); border: 2px solid var(--primary); box-shadow: 0 0 0 4px #e0e7ff; }
.track-step.current { color: var(--text); font-weight: 600; }
.tracker-card { margin-bottom: 20px; padding: 20px 30px; }
.tracker-card .track-step { font-size: .85rem; }
.tracker-card .track-step .dot { width: 30px; height: 30px; }
.tracker-card .track-step::before { top: 14px; }

/* Empty state */
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state .big { font-size: 3rem; }

/* Chat — rounder, friendlier for customers */
body.customer .chat { background: #f5f3ff; }
body.customer .bubble { border-radius: 18px 18px 18px 4px; }
body.customer .msg.mine .bubble { background: linear-gradient(135deg, #4f46e5, #7c3aed); border-radius: 18px 18px 4px 18px; }

/* Landing page */
.landing-hero { text-align: center; color: #fff; padding: 90px 20px 100px; background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.landing-hero h1 { font-size: 2.8rem; margin: 0 0 12px; }
.landing-hero p { font-size: 1.15rem; opacity: .92; max-width: 560px; margin: 0 auto 30px; }
.landing .navbar { position: static; }
.steps { max-width: 1000px; margin: -50px auto 50px; padding: 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: #fff; border-radius: 16px; padding: 28px 24px; text-align: center; box-shadow: 0 8px 24px rgba(15, 23, 42, .08); }
.step-icon { font-size: 2.2rem; }
.step h3 { margin: 10px 0 6px; }
.step p { color: var(--muted); margin: 0; }
.site-foot { text-align: center; color: var(--muted); padding: 30px 0; font-size: .9rem; }

@media (max-width: 800px) {
    .steps { grid-template-columns: 1fr; margin-top: -30px; }
    .landing-hero h1 { font-size: 2rem; }
    .hero { padding: 24px; }
}

/* ---------- Coloured + animated status (customer side) ---------- */
.tracker { --sc: #3b82f6; }
.tracker.s-open { --sc: #3b82f6; } .tracker.s-in_progress { --sc: #f59e0b; }
.tracker.s-resolved { --sc: #10b981; } .tracker.s-closed { --sc: #64748b; }

.track-step::before { height: 4px; top: 10px; border-radius: 2px; transform-origin: left; }
.tracker-card .track-step::before { top: 13px; }
.track-step.done::before { background: var(--sc); animation: fillLine .6s ease both; }
.track-step.current::before { background: var(--sc); animation: fillLine .6s ease both; }
.track-step.done .dot { background: var(--sc); color: #fff; animation: pop .5s ease both; }
.track-step.current .dot { border-color: var(--sc); color: var(--sc); box-shadow: none; animation: ring 1.6s ease-out infinite; }
.track-step.current { color: var(--sc); }

/* "In progress": moving stripes on the line = work is happening */
.tracker.s-in_progress .track-step.current::before {
    background: repeating-linear-gradient(-45deg, var(--sc) 0 6px, #fde68a 6px 12px); background-size: 24px 100%;
    animation: fillLine .6s ease both, stripes .8s linear infinite .6s; }
/* "Open": waiting – dot blinks */
.tracker.s-open .track-step.current .dot { animation: ring 1.6s ease-out infinite, blink 1.6s ease-in-out infinite; }

/* Ticket cards get the status colour */
.ticket-card { border-top: 5px solid var(--sc); animation: slideIn .4s ease both; }
.ticket-card:hover { box-shadow: 0 10px 24px rgba(15, 23, 42, .12); border-color: var(--sc); }
.ticket-card .badge.live { background: var(--sc-soft); color: var(--sc-dark); }
.s-in_progress.ticket-card .badge.live::before, .s-open.ticket-card .badge.live::before {
    content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sc); margin-right: 6px; animation: blink 1.2s ease-in-out infinite; }
.tc-rating { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.tc-rating .stars-view { font-size: 1.15rem; letter-spacing: 1px; }
.rate-me { color: #b45309; background: #fef3c7; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; display: inline-block; animation: pulse 2s ease-in-out infinite; }

/* Ticket page layout with history under the chat */
.main-col { min-width: 0; }

/* mobile: ticket cards must never be wider than the screen */
.ticket-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
