/* CityPins - Global Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Page transitions */
#app-content {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toast animations */
.toast-enter {
    animation: toastIn 0.3s ease forwards;
}
.toast-exit {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* Pin card */
.pin-card {
    transition: all 0.2s ease;
}
.pin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.08);
}

.pin-card-closed {
    border-color: #fecaca;
    background-color: #fef2f2;
}
.pin-card-closed:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pin-card-highlighted {
    border: 2px solid transparent;
    background-image: linear-gradient(#fffbf7, #fdf6ff), linear-gradient(135deg, #ef4444, #f97316, #8b5cf6);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 4px 20px -4px rgba(139, 92, 246, 0.2), 0 2px 8px -2px rgba(239, 68, 68, 0.12);
    position: relative;
}
/* Highlight star badge — sits outside the card via HTML wrapper */
.pin-highlight-star {
    position: absolute;
    top: -8px;
    right: 12px;
    font-size: 10px;
    color: white;
    background: linear-gradient(135deg, #ef4444, #8b5cf6);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.35);
    z-index: 3;
}

/* Boosted gradient bar — clipped by overflow:hidden to match card corners */
.pin-card-boosted {
    overflow: hidden;
}
.pin-card-boosted::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ef4444, #f97316, #eab308);
    z-index: 1;
}

/* Engagement buttons */
.engage-btn {
    transition: all 0.15s ease;
}
.engage-btn:hover {
    transform: scale(1.1);
}
.engage-btn.active-like {
    color: #ef4444;
}
.engage-btn.active-downvote {
    color: #64748b;
}

/* Modal animation */
#modal-overlay:not(.hidden) #modal-content {
    animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Tab styling */
.tab-btn {
    position: relative;
    transition: color 0.2s;
}
.tab-btn.active {
    color: #ef4444;
}
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    border-radius: 1px;
}

/* Badge pulse */
.badge-pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Form input focus */
.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* Select dropdown — custom arrow with proper spacing */
select,
select.form-input {
    padding-right: 2.5rem !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.875rem center !important;
    background-size: 12px !important;
}

/* Admin sidebar */
.admin-nav-item {
    transition: all 0.15s ease;
}
.admin-nav-item.active {
    background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(139,92,246,0.1));
    color: #dc2626;
    border-left: 3px solid #ef4444;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dropdown animations */
.dropdown-enter {
    animation: dropIn 0.15s ease;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Category filter strip */
.cat-filter-wrap {
    position: relative;
}
.cat-filter-wrap .cat-fade-left,
.cat-filter-wrap .cat-fade-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 48px;
    z-index: 2;
    display: flex;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.cat-filter-wrap .cat-fade-left {
    left: 0;
    background: linear-gradient(to right, #f9fafb 30%, transparent);
    justify-content: flex-start;
    padding-left: 2px;
}
.cat-filter-wrap .cat-fade-right {
    right: 0;
    background: linear-gradient(to left, #f9fafb 30%, transparent);
    justify-content: flex-end;
    padding-right: 2px;
}
.cat-filter-wrap .cat-fade-left.visible,
.cat-filter-wrap .cat-fade-right.visible {
    opacity: 1;
    pointer-events: auto;
}
.cat-filter-wrap .cat-scroll-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    font-size: 11px;
    transition: background 0.15s, box-shadow 0.15s;
}
.cat-filter-wrap .cat-scroll-btn:hover {
    background: #f1f5f9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
#category-filter {
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
    padding-left: 40px;
    padding-right: 40px;
}
#category-filter::-webkit-scrollbar {
    display: none;
}

/* Category filter buttons */
.cat-filter-btn:not(.active):hover {
    background-color: #e5e7eb;
}
.cat-filter-btn.active,
.cat-filter-btn.active:hover,
.cat-filter-btn.active:focus {
    background-color: #ef4444 !important;
    color: #fff !important;
}
@media (hover: none) {
    .cat-filter-btn:not(.active):hover {
        background-color: #f3f4f6;
    }
}

/* Mobile bottom nav */
@media (max-width: 640px) {
    main {
        padding-bottom: 80px !important;
    }
}
