/* Additional dashboard styles beyond base template */

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.live-feed-item {
    animation: fadeIn 0.3s ease-out;
}

/* Leaderboard */
.leaderboard-item:hover {
    background: var(--bg-card-hover);
    margin: 0 -8px;
    padding: 8px;
    border-radius: 4px;
}

/* Weather cards */
.weather-card:hover {
    border-color: var(--accent-green);
    transform: translateY(-2px);
    transition: all 0.2s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 24px;
    }
}

/* HTMX loading indicator */
.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

/* GPS Location Button */
#gps-locate-btn {
    /* Matches Leaflet bar <a> styling */
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #333;
    text-decoration: none;
    background: #fff;
    transition: background 0.2s;
}

#gps-locate-btn:hover {
    background: #f4f4f4;
    color: #333;
}

#gps-locate-btn.locating {
    color: #4285f4;
    animation: gps-pulse 1s ease-in-out infinite;
}

@keyframes gps-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* APRSThursday Toggle Button */
#aprsthursday-fab {
    margin-left: auto;
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.aprsthursday-toggle-off {
    background: rgba(30, 30, 40, 0.92);
    color: #9ca3af;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.aprsthursday-toggle-off:hover {
    background: rgba(40, 40, 50, 0.95);
    color: #e5e7eb;
}

.aprsthursday-toggle-thursday {
    background: #1a1a2e;
    color: #fbbf24;
    border: 2px solid #d97706 !important;
    animation: aprsthursday-pulse 2.5s ease-in-out infinite;
}

.aprsthursday-toggle-thursday:hover {
    background: #2d2410;
    color: #fde68a;
}

.aprsthursday-toggle-on {
    background: rgba(217, 119, 6, 0.95);
    color: #fff;
    border: 1px solid rgba(217, 119, 6, 0.8) !important;
    box-shadow: 0 2px 12px rgba(217, 119, 6, 0.3);
}

.aprsthursday-toggle-on:hover {
    background: rgba(217, 119, 6, 1);
}

@keyframes aprsthursday-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
    50% { box-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 0 5px rgba(217, 119, 6, 0.25), 0 0 16px rgba(251, 191, 36, 0.2); }
}

@keyframes at-spin {
    to { transform: rotate(360deg); }
}

/* Weather overlay toggle - styled inline in toolbar */

/* APRSThursday Bottom Sheet */
.aprsthursday-sheet {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 1002;
    background: rgba(20, 20, 30, 0.96);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px 16px 0 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
}

.aprsthursday-sheet.dragging {
    transition: none !important;
}

.aprsthursday-sheet.half {
    transform: translateY(40%);
}

.aprsthursday-sheet.full {
    transform: translateY(5%);
}

.aprsthursday-sheet.fullscreen {
    transform: translateY(0);
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    z-index: 2000;
}

.aprsthursday-sheet-handle {
    width: 100%;
    padding: 6px 0;
    cursor: grab;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aprsthursday-sheet.peek {
    transform: translateY(calc(100% - 56px));
}

.aprsthursday-sheet-header {
    padding: 2px 12px 4px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    touch-action: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.aprsthursday-stat-pill {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 11px;
    color: #d1d5db;
    white-space: nowrap;
}

.aprsthursday-stat-pill strong {
    color: #22c55e;
}

.aprsthursday-log {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
    contain: content;
}

.aprsthursday-log-entry {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 12px;
    color: #d1d5db;
}

.aprsthursday-log-entry.checkin {
    border-left: 3px solid #d97706;
    padding-left: 8px;
}

.aprsthursday-log-entry .timestamp {
    color: #6b7280;
    font-family: monospace;
    font-size: 11px;
    flex-shrink: 0;
}

.aprsthursday-log-entry .callsign {
    color: #60a5fa;
    cursor: pointer;
    font-weight: 500;
    flex-shrink: 0;
}

.aprsthursday-log-entry .callsign:hover {
    text-decoration: underline;
}

.aprsthursday-log-entry .type-badge {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    flex-shrink: 0;
}

.aprsthursday-log-entry .type-badge.chk {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
}

.aprsthursday-log-entry .type-badge.pos {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.aprsthursday-log-entry .message {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.aprsthursday-date-select {
    background: rgba(40,40,55,0.95);
    color: #e0e0e0;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    margin-left: auto;
}

/* === Viewport Live Packet Panel === */
.live-packet-sheet {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 1002;
    background: rgba(20, 20, 30, 0.96);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    min-height: 56px;
    max-height: 85vh;
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.live-packet-sheet.dragging {
    transition: none !important;
    user-select: none;
}

.live-packet-sheet-handle {
    width: 100%;
    padding: 8px 0 4px 0;
    cursor: ns-resize;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-packet-sheet-handle:active {
    cursor: ns-resize;
}

.live-packet-sheet-header {
    padding: 2px 12px 4px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    touch-action: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.live-packet-stat-pill {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 11px;
    color: #d1d5db;
    white-space: nowrap;
}

.live-packet-stat-pill strong {
    color: #22c55e;
}

.live-packet-log {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
    contain: content;
}

.live-packet-row {
    padding: 3px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 11px;
    color: #d1d5db;
}

.live-packet-row:hover {
    background: rgba(255,255,255,0.04);
}

.live-packet-expand {
    color: #9ca3af;
    font-size: 10px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    padding-top: 2px;
    transition: transform 0.15s ease;
}

.live-packet-expand.expanded {
    transform: rotate(90deg);
}

.live-packet-content {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-packet-timestamp {
    color: #6b7280;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}

.live-packet-row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.live-packet-row:hover .live-packet-row-actions {
    opacity: 1;
}

.live-packet-row-btn {
    background: none;
    border: none;
    color: #9ca3af;
    padding: 1px 4px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
}

.live-packet-row-btn:hover {
    color: #60a5fa;
}

.live-packet-row-btn.copied {
    color: #22c55e;
}

.live-packet-raw {
    display: none;
    background: rgba(15, 15, 25, 0.8);
    padding: 4px 8px 4px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 11px;
    color: #60a5fa;
    white-space: pre-wrap;
    word-break: break-all;
}

.live-packet-raw.visible {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.live-packet-raw code {
    flex: 1;
    word-break: break-all;
}

/* Resume auto-scroll button */
.live-packet-resume {
    position: sticky;
    bottom: 0;
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 11px;
    margin: 4px auto;
    display: none;
    text-align: center;
}

.live-packet-resume.visible {
    display: block;
}
