/* View specific styles */

/* Search View */
.search-results {
    margin-top: 1rem;
    padding-bottom: 2rem;
}

/* Departures View */
.dep-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dep-header h2 {
    margin: 0;
}

.dep-clock {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-primary);
    white-space: nowrap;
}

.departure-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.departure-row:last-child {
    border-bottom: none;
}

.line-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 32px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    margin-right: 12px;
    color: white;
}

.time-col {
    text-align: right;
    min-width: 60px;
}

.time-real {
    font-weight: 700;
    color: var(--text-primary);
}

.time-sched {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 4px;
}

.departure-info {
    flex: 1;
}

.departure-dest {
    font-weight: 600;
}

.departure-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mode-emoji {
    font-size: 1.2rem;
    margin-right: 8px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.rt-dot {
    color: #4caf50;
    font-size: 0.6rem;
    vertical-align: middle;
}

.time-est {
    font-weight: 700;
    color: #ff9800;
}

.time-cancelled {
    font-weight: 700;
    color: #f44336;
    font-size: 0.85rem;
}

.departure-row.cancelled {
    opacity: 0.6;
}

.departure-row.cancelled .departure-dest {
    text-decoration: line-through;
}

/* Journey View */
.journey-card {
    border-left: 4px solid var(--accent);
}

.leg-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9rem;
}

.leg-time {
    font-weight: 600;
    width: 50px;
}

.leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border);
    margin: 0 12px;
}

.leg-walk {
    color: var(--text-secondary);
    font-style: italic;
}

.leg-icon {
    margin-right: 8px;
    font-size: 1rem;
}

.leg-detail {
    flex: 1;
    min-width: 0;
}

.journey-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 4px;
}

.journey-times {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.autocomplete-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item:active {
    background: var(--bg-tertiary);
}

.autocomplete-item.loading {
    cursor: default;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
}

.autocomplete-name {
    font-weight: 600;
    color: var(--text-primary);
}

.autocomplete-municipality {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Time picker */
.time-mode-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.time-badge {
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

.time-badge.active {
    border-color: var(--accent);
    color: var(--accent);
}

.time-detail {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 10px;
}

.time-detail-header {
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.time-detail-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-text-input {
    width: 70px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

.input-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 4px;
}

/* Calendar popup */
.calendar-popup {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 200;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.calendar-header button {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
}

.calendar-header span {
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.calendar-grid .day-header {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 4px 0;
    font-weight: 600;
}

.calendar-grid .day {
    padding: 6px 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-grid .day:hover {
    background: var(--bg-tertiary);
}

.calendar-grid .day.selected {
    background: var(--accent);
    color: white;
    font-weight: 700;
}

.calendar-grid .day.today {
    border: 1px solid var(--accent);
}

.calendar-grid .day.disabled {
    color: var(--text-muted);
    cursor: default;
}

.calendar-grid .day.disabled:hover {
    background: none;
}

.calendar-grid .day.empty {
    cursor: default;
}

/* Donate page */
.donate-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 0.5rem;
}

.donate-intro {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.donate-divider {
    width: 60px;
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Ko-fi button — exact Ko-fi widget style */
.btn-container {
    display: inline-block;
    white-space: nowrap;
    min-width: 160px;
}

a.kofi-button {
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
    line-height: 36px;
    min-width: 150px;
    display: inline-block;
    background-color: #006345;
    padding: 2px 12px;
    text-align: center;
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    overflow-clip-margin: unset;
    overflow: clip;
    font-family: 'Quicksand', Helvetica, 'Century Gothic', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: opacity 0.2s;
}

a.kofi-button:hover {
    opacity: 0.85;
    color: #f5f5f5;
}

a.kofi-button:active {
    opacity: 0.75;
}

span.kofitext {
    color: #fff;
    letter-spacing: -0.15px;
    vertical-align: middle;
    line-height: 33px;
}

img.kofiimg {
    display: initial;
    vertical-align: middle;
    height: 15px;
    width: 22px;
    margin-right: 5px;
    margin-bottom: 3px;
    animation: kofi-wiggle 3s infinite;
}

@keyframes kofi-wiggle {
    0% { transform: rotate(0) scale(1); }
    60% { transform: rotate(0) scale(1); }
    75% { transform: rotate(0) scale(1.12); }
    80% { transform: rotate(0) scale(1.1); }
    84% { transform: rotate(-10deg) scale(1.1); }
    88% { transform: rotate(10deg) scale(1.1); }
    92% { transform: rotate(-10deg) scale(1.1); }
    96% { transform: rotate(10deg) scale(1.1); }
    100% { transform: rotate(0) scale(1); }
}

/* Lambo button — exact match from matinen.com */
.lambo-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-lambo {
    font-family: 'Cookie', cursive, sans-serif;
    background: transparent;
    color: #000;
    font-size: 18px;
    padding: 7px 22px 7px 60px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    position: relative;
    border: none;
    text-decoration: none;
    overflow: visible;
    height: 36px;
    box-sizing: border-box;
    z-index: 1;
    transition: 0.3s;
    cursor: pointer;
}

.btn-lambo::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    background-size: 400%;
    z-index: -2;
    filter: blur(4px);
    border-radius: 34px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    animation: glowing 20s linear infinite;
}

.btn-lambo::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #FFDD00;
    border-radius: 30px;
    z-index: -1;
    box-shadow: 0 3px 5px rgba(0,0,0,0.1);
    transition: 0.3s;
}

.btn-lambo:hover {
    transform: translateY(-2px);
}

.btn-lambo:hover::before {
    opacity: 1;
}

.btn-lambo img.lambo-car {
    height: 55px;
    width: auto;
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 3px 3px rgba(0,0,0,0.3));
    pointer-events: none;
    z-index: 10;
}

.btn-lambo:hover img.lambo-car {
    transform: translateY(-50%) translateX(8px) skewX(-5deg) scale(1.1);
}

.btn-lambo .lambo-coin {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    filter: drop-shadow(0 0 3px white);
}

.btn-lambo:hover .lambo-coin {
    animation: explode 0.8s ease-out forwards, marginShake 0.1s infinite;
}

.btn-lambo:hover .lambo-coin:nth-of-type(2) { --x: -80px; --y: -70px; --r: -45deg; animation-delay: 0s; width: 20px; height: 20px; }
.btn-lambo:hover .lambo-coin:nth-of-type(3) { --x: 80px; --y: -60px; --r: 45deg; animation-delay: 0.1s; width: 19px; height: 19px; }
.btn-lambo:hover .lambo-coin:nth-of-type(4) { --x: -60px; --y: 70px; --r: -135deg; animation-delay: 0.05s; }
.btn-lambo:hover .lambo-coin:nth-of-type(5) { --x: 60px; --y: 60px; --r: 135deg; animation-delay: 0.15s; }
.btn-lambo:hover .lambo-coin:nth-of-type(6) { --x: 0px; --y: -90px; --r: 0deg; animation-delay: 0.2s; }
.btn-lambo:hover .lambo-coin:nth-of-type(7) { --x: -100px; --y: 0px; --r: -90deg; animation-delay: 0.1s; }
.btn-lambo:hover .lambo-coin:nth-of-type(8) { --x: 100px; --y: 15px; --r: 90deg; animation-delay: 0.25s; }
.btn-lambo:hover .lambo-coin:nth-of-type(9) { --x: 0px; --y: 80px; --r: 180deg; animation-delay: 0.15s; }

@keyframes glowing {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}

@keyframes explode {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translate(var(--x), var(--y)) scale(1.5) rotate(calc(720deg + var(--r))); opacity: 0; }
}

@keyframes marginShake {
    0%, 100% { margin-left: -2px; margin-top: 1px; }
    25% { margin-left: 1px; margin-top: -2px; }
    50% { margin-left: 2px; margin-top: 1px; }
    75% { margin-left: -1px; margin-top: 2px; }
}

/* Wallet popup — toggled on search page via Lambo button */
.wallet-popup {
    width: calc(100vw - 32px);
    max-width: 500px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #FFDD00;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 20px rgba(255, 221, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-top: 12px;
    display: none;
}

.wallet-popup.open {
    display: block;
}

/* Wallet panel — always visible on donate page, full width */
.wallet-panel {
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #FFDD00;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 20px rgba(255, 221, 0, 0.1);
    backdrop-filter: blur(10px);
}

.wallet-row {
    display: flex;
    align-items: center;
    background: #000;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid #222;
    transition: 0.2s;
    height: 44px;
    position: relative;
    overflow: hidden;
}

.wallet-row:hover {
    border-color: #555;
}

.wallet-row:last-child {
    margin-bottom: 0;
}

.coin-logo-container {
    width: 44px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #080808;
    border-right: 1px solid #222;
    flex-shrink: 0;
}

.coin-logo-container img {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.2));
}

.wallet-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #ccc;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    padding: 0 12px;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-btn-wallet {
    width: 50px;
    min-width: 50px;
    height: 100%;
    background: #222;
    border: none;
    border-left: 1px solid #333;
    color: #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

.copy-btn-wallet:hover {
    background: #333;
    color: #fff;
}

.copy-btn-wallet:active {
    background: #FFDD00;
    color: #000;
}

.copy-btn-wallet svg {
    width: 18px;
    height: 18px;
}