/* Game Feed - Mobile-First TikTok/Reels Style Interface */

.hunt-feed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    background: #000;
    color: #fff;
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0 !important;
    padding: 0 !important;
    
    /* Initial state - slide in from bottom */
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hunt-feed.active {
    transform: translateY(0);
}

/* Mobile-first design */
.hunt-feed.mobile {
    /* Full screen mobile experience */
}

.hunt-feed.desktop {
    /* Desktop full-screen overlay */
    background: rgba(0, 0, 0, 1);
    display: flex;
    flex-direction: column;
}

/* Header */
.hunt-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 100%);
    position: relative;
    z-index: 10002 !important; /* Always above everything else */
    min-height: 56px;
    backdrop-filter: blur(20px);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 87, 255, 0.8);
    border: 1px solid var(--thingvalla-primary);
    color: var(--thingvalla-white);
    padding: 12px 16px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: auto;
    min-height: 44px;
}

.back-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.back-btn:hover {
    background: var(--thingvalla-primary);
    border-color: var(--thingvalla-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 87, 255, 0.4);
}

.hunt-feed-title {
    text-align: center;
    flex: 1;
    margin: 0 12px;
    min-width: 0;
}

.hunt-feed-title span:first-child {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hunt-feed-title span:last-child {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    font-weight: 400;
}

.hunt-feed-actions {
    display: flex;
    gap: 6px;
}

.filter-btn {
    background: rgba(0, 87, 255, 0.8);
    border: 1px solid var(--thingvalla-primary);
    color: var(--thingvalla-white);
    padding: 6px;
    border-radius: 12px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.filter-btn:hover {
    background: var(--thingvalla-primary);
    border-color: var(--thingvalla-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 87, 255, 0.4);
}

/* Main Content */
.hunt-feed-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Ensure AI button is positioned relative to this container */
}

.image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    border-radius: 8px;
}

/* Image positioning */
.image-wrapper .original-image {
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
    opacity: 1 !important;
}

.image-wrapper .processed-image {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    pointer-events: none !important;
    z-index: 2 !important;
    border-radius: 8px !important;
}

/* Disable any hover effects on hunt feed images */
.hunt-feed .image-wrapper:hover .processed-image {
    opacity: 0 !important;
}

.hunt-feed .image-wrapper:hover .original-image {
    opacity: 1 !important;
}

/* Show processed image only when AI toggle is active (no more hover) */
.hunt-feed .image-wrapper.show-processed .processed-image {
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 3 !important;
}

.hunt-feed .image-wrapper.show-processed .original-image {
    opacity: 0 !important;
}

/* Ensure original image is always visible by default */
.hunt-feed .image-wrapper:not(.show-processed) .original-image {
    opacity: 1 !important;
    display: block !important;
}

.hunt-feed .image-wrapper:not(.show-processed) .processed-image {
    opacity: 0 !important;
    display: block !important;
}

/* AI Toggle button - only shows after user has scored */
.ai-toggle-btn {
    position: absolute !important;
    bottom: 12px !important;
    right: 12px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    border: 2px solid rgba(0, 87, 255, 0.6) !important;
    color: var(--thingvalla-primary) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(10px) !important;
    z-index: 1000 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    display: block !important;
    visibility: visible !important;
}

.ai-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: var(--thingvalla-primary);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

.ai-toggle-btn.active {
    background: var(--thingvalla-primary);
    border-color: var(--thingvalla-primary);
    color: #000;
    box-shadow: 0 2px 12px rgba(78, 205, 196, 0.5);
}

.ai-toggle-btn span {
    display: block;
}

/* AI button replaces old mobile hints */

.image-wrapper.locked img.blurred {
    filter: blur(20px);
    opacity: 0.5;
}

.lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.lock-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.lock-message {
    font-size: 14px;
    font-weight: 500;
}


/* Actions Bar */
.image-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.2s ease;
    min-width: 60px;
    min-height: 60px;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.action-btn.active {
    color: #ff6b6b;
}

.action-btn svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.action-btn span {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.9;
}

.score-btn.scored {
    color: var(--thingvalla-primary);
    opacity: 0.6;
    cursor: default;
}

.score-btn.scored svg {
    fill: var(--thingvalla-primary);
}

.score-btn.locked {
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

/* AI Button Styling */
.ai-btn {
    display: none; /* Hidden by default */
}

.ai-btn.active {
    color: var(--thingvalla-primary) !important;
    background: rgba(78, 205, 196, 0.2) !important;
}

.ai-btn.active svg {
    stroke: var(--thingvalla-primary) !important;
}

/* Score Information Display */
.score-info {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.scores-display {
    font-size: 16px;
    font-weight: 600;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    letter-spacing: 0.5px;
}

/* Beta tag styling for AI estimate */
.scores-display small {
    font-size: 11px;
    opacity: 0.7;
    font-weight: normal;
    margin-left: 2px;
}

/* Image Info */
.image-info {
    padding: 16px;
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
}

.unit-info, .user-info, .score-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.unit-info .unit-name {
    font-size: 16px;
    font-weight: 600;
}

.unit-info .animal-type {
    font-size: 14px;
    opacity: 0.8;
}

.user-info .username {
    font-size: 14px;
    font-weight: 500;
    color: var(--thingvalla-primary);
}

.user-info .upload-date {
    font-size: 12px;
    opacity: 0.7;
}

.score-info span {
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-right: 8px;
}

/* Progress Bar */
.hunt-feed-progress {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--thingvalla-primary) 0%, var(--thingvalla-secondary) 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    text-align: center;
    opacity: 0.8;
}

/* Filters Panel */
.filters-panel {
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    display: flex;
    flex-direction: column;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

/* Force visibility for all filter content */
.filters-panel * {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.filters-panel select {
    display: block !important;
}

.filters-panel button {
    display: block !important;
}

.filters-panel.active {
    right: 0;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filters-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-filters {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filters-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    /* Debug styling to make content visible */
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    min-height: 200px !important;
    display: flex !important;
    flex-direction: column !important;
}

.filter-group {
    margin-bottom: 24px !important;
    /* Debug: Make filter groups visible */
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    padding: 12px !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    display: block !important;
    width: 100% !important;
}

.filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 1;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.filter-group select {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--thingvalla-primary);
    box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.3);
}

.filter-group select option {
    background: #1a1a1a;
    color: #fff;
}

.apply-filters-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--thingvalla-primary) 0%, var(--thingvalla-secondary) 100%);
    border: none;
    color: var(--thingvalla-white);
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(0, 87, 255, 0.3);
}

.apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 87, 255, 0.4);
}

/* Quick Score Modal */
.quick-score-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(20px);
}

.score-slider-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 90%;
    width: 320px;
}

.score-instructions {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 20px;
}

.score-display {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--thingvalla-primary);
    text-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
}

#score-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    margin-bottom: 24px;
    -webkit-appearance: none;
}

#score-slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--thingvalla-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

#score-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--thingvalla-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.score-actions {
    display: flex;
    gap: 12px;
}

.score-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cancel-score {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.submit-score {
    background: linear-gradient(135deg, var(--thingvalla-primary) 0%, var(--thingvalla-secondary) 100%);
    border: none;
    color: var(--thingvalla-white);
}

.submit-score:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 87, 255, 0.3);
}

/* Loading States */
.hunt-feed-loading, .hunt-feed-empty {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1 !important; /* Below header */
    padding: 80px 20px 20px 20px; /* Top padding for header */
    text-align: center;
    background: #000;
    backdrop-filter: blur(10px);
    margin: 0 !important;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid var(--thingvalla-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text, .empty-title {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.8;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-message {
    font-size: 14px;
    opacity: 0.6;
    text-align: center;
    max-width: 280px;
    line-height: 1.4;
}

/* Desktop Responsive Adjustments */
@media (min-width: 769px) {
    .hunt-feed {
        /* Ensure full screen on desktop */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
    }
    
    .hunt-feed-header {
        padding: 16px 32px;
        min-height: 64px;
        background: rgba(0, 0, 0, 0.9);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    }
    
    .hunt-feed-content {
        max-width: 100%;
        margin: 0;
    }
    
    .image-container {
        padding: 20px;
    }
    
    .image-info {
        padding: 0 32px;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .hunt-feed-loading, .hunt-feed-empty {
        padding: 100px 20px 20px 20px;
        z-index: 1 !important; /* Ensure below header on desktop too */
    }
    
    .back-btn {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .filter-btn {
        width: 44px;
        height: 44px;
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 480px) {
    .hunt-feed-header {
        padding: 6px 12px;
        min-height: 52px;
        z-index: 10002 !important; /* Ensure header is above empty state */
        position: relative !important;
        background: rgba(0,0,0,0.9) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .hunt-feed-loading, .hunt-feed-empty {
        padding: 70px 20px 20px 20px; /* More top padding to clear header */
        z-index: 1 !important; /* Much lower z-index - well below header */
        top: 0 !important;
        position: absolute !important;
    }
    
    .back-btn {
        padding: 5px 8px;
        font-size: 12px;
        border-radius: 14px;
    }
    
    .back-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .hunt-feed-title {
        margin: 0 8px;
    }
    
    .hunt-feed-title span:first-child {
        font-size: 14px;
    }
    
    .hunt-feed-title span:last-child {
        font-size: 10px;
    }
    
    .filter-btn {
        width: 32px;
        height: 32px;
        padding: 5px;
        border-radius: 10px;
    }
    
    .filter-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Tablet and larger mobile screens */
@media (min-width: 481px) and (max-width: 767px) {
    .hunt-feed-header {
        padding: 8px 14px;
        min-height: 54px;
    }
    
    .back-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .hunt-feed-title span:first-child {
        font-size: 15px;
    }
    
    .filter-btn {
        width: 34px;
        height: 34px;
    }
}

/* Desktop Responsive */
@media (min-width: 768px) {
    .hunt-feed.desktop {
        padding: 20px;
        align-items: center;
        justify-content: center;
    }
    
    .hunt-feed.desktop .hunt-feed-content {
        max-width: 90vw;
        max-height: 90vh;
        background: rgba(0, 0, 0, 0.8);
        border-radius: 12px;
        overflow: hidden;
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .hunt-feed.desktop .hunt-feed-header {
        padding: 12px 20px;
        min-height: 60px;
        border-radius: 12px 12px 0 0;
    }
    
    .hunt-feed.desktop .back-btn {
        padding: 8px 16px;
        font-size: 14px;
        border-radius: 18px;
    }
    
    .hunt-feed.desktop .back-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .hunt-feed.desktop .hunt-feed-title span:first-child {
        font-size: 18px;
    }
    
    .hunt-feed.desktop .hunt-feed-title span:last-child {
        font-size: 12px;
    }
    
    .hunt-feed.desktop .filter-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
        border-radius: 14px;
    }
    
    .hunt-feed.desktop .filter-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .hunt-feed.desktop .image-container {
        max-height: 60vh;
        min-height: 400px;
    }
    
    .hunt-feed.desktop .image-wrapper {
        max-height: 60vh;
        min-height: 400px;
    }
    
    .hunt-feed.desktop .image-wrapper img {
        max-height: 60vh;
        max-width: 90vw;
        width: auto;
        height: auto;
        object-fit: contain;
    }
    
    .filters-panel {
        max-width: 400px;
        border-radius: 12px 0 0 12px;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Large desktop screens */
@media (min-width: 1200px) {
    .hunt-feed.desktop .hunt-feed-content {
        max-width: 85vw;
        max-height: 85vh;
    }
    
    .hunt-feed.desktop .hunt-feed-header {
        padding: 16px 24px;
        min-height: 64px;
    }
    
    .hunt-feed.desktop .back-btn {
        padding: 10px 20px;
        font-size: 15px;
    }
}

/* Smooth touch interactions - exclude interactive elements */
.hunt-feed .feed-content,
.hunt-feed .image-card,
.hunt-feed .stats-grid {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Allow interactions on interactive elements */
.hunt-feed input,
.hunt-feed button,
.hunt-feed select,
.hunt-feed textarea,
.hunt-feed a,
.hunt-feed .btn,
.hunt-feed .form-control,
.hunt-feed .modal *,
.modal * {
    -webkit-user-select: auto;
    user-select: auto;
    -webkit-touch-callout: auto;
}

/* iOS safe area support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .hunt-feed {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .hunt-feed-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
}

/* Haptic feedback animation */
@keyframes haptic-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.haptic-feedback {
    animation: haptic-pulse 0.2s ease-out;
}

/* Swipe hint animations */
@keyframes swipe-hint {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-10px); }
}

.swipe-hint {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    opacity: 0.5;
    animation: swipe-hint 2s ease-in-out infinite;
    pointer-events: none;
}
/* Reset Filters Button */
.reset-filters-btn {
    margin-top: 20px;
    padding: 12px 24px;
    background: rgba(0, 87, 255, 0.2);
    color: var(--thingvalla-primary);
    border: 1px solid var(--thingvalla-primary);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-filters-btn:hover {
    background: rgba(0, 87, 255, 0.3);
    transform: scale(1.05);
}

.empty-message {
    font-size: 14px;
    opacity: 0.6;
    margin-top: 8px;
}

/* Navigation Buttons */
.image-navigation {
    position: absolute;
    bottom: 120px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.nav-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn svg {
    width: 24px;
    height: 24px;
}

/* Disable buttons when at limits */
.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn:disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .image-navigation {
        bottom: 100px;
        right: 15px;
    }
    
    .nav-btn {
        width: 44px;
        height: 44px;
    }
}

/* Ensure login modal appears above hunt feed */
#loginModal {
    z-index: 10001 !important;
}

.modal-backdrop.show {
    z-index: 10000 !important;
}

/* Ensure any Bootstrap modal appears above hunt feed when hunt feed is active */
.hunt-feed.active ~ .modal,
.hunt-feed.active + .modal,
body.hunt-feed-active .modal {
    z-index: 10001 !important;
}

.hunt-feed.active ~ .modal-backdrop,
.hunt-feed.active + .modal-backdrop,
body.hunt-feed-active .modal-backdrop {
    z-index: 10000 !important;
}

/* State context styling for hunt feed header */
#current-unit-name {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    color: white;
    text-align: center;
}

#current-unit-name .unit-id {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

#current-unit-name .state-context {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 2px;
}
