/* NearbyYou Take Me Anywhere V2 - Enhanced Responsive Tinder Style */

:root {
    --nearbyyou-pink: #dc0866;
    --nearbyyou-pink-dark: #b30553;
    --nearbyyou-pink-light: #ff0a75;
}

/* Prevent page scroll when modal is open - matches Smart Intent approach */
html.ny-modal-open,
body.ny-modal-open {
    overflow: hidden !important;
}

/* ==========================================
   CARD-STYLE TRIGGER BUTTON
   ========================================== */

.nearbyyou-tma-trigger-card {
    display: inline-block;
    width: 200px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--nearbyyou-pink) 0%, var(--nearbyyou-pink-light) 100%);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 8, 102, 0.4);
}

.nearbyyou-tma-trigger-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 25px rgba(220, 8, 102, 0.5);
}

.nearbyyou-tma-trigger-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.nearbyyou-tma-trigger-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.nearbyyou-tma-trigger-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.nearbyyou-tma-trigger-tagline {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.nearbyyou-tma-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nearbyyou-tma-trigger-card:hover .nearbyyou-tma-trigger-btn {
    background: white;
    color: var(--nearbyyou-pink);
    border-color: white;
}

/* OLD BUTTON STYLE (REMOVE) */
.nearbyyou-tma-button {
    display: none;
}

/* Modal */
.nearbyyou-tma-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
}

.nearbyyou-tma-modal.active {
    display: block;
}

.nearbyyou-tma-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.nearbyyou-tma-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nearbyyou-tma-modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

/* Logo Header */
.nearbyyou-tma-logo-header {
    padding: 20px;
    background: #ffffff;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nearbyyou-tma-logo {
    max-width: 180px;
    height: auto;
}

/* Close Button */
.nearbyyou-tma-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nearbyyou-tma-modal-close:hover {
    background: #ffffff;
    transform: rotate(90deg);
}

/* Filter Screen */
.nearbyyou-tma-filters {
    padding: 24px 20px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.nearbyyou-tma-form-group {
    margin-bottom: 24px;
}

.nearbyyou-tma-form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Category Grid */
.nearbyyou-tma-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
}

.nearbyyou-tma-category-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nearbyyou-tma-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    background: #f8f8f8;
    border: 3px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 100px;
}

.nearbyyou-tma-category-option input[type="radio"]:checked + .nearbyyou-tma-category-card {
    background: #fff0f7;
    border-color: var(--nearbyyou-pink);
}

.nearbyyou-tma-category-card:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.nearbyyou-tma-category-icon {
    font-size: 32px;
}

.nearbyyou-tma-category-label {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.2;
}

/* Select Dropdowns */
.nearbyyou-tma-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 500;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nearbyyou-tma-select:focus {
    outline: none;
    border-color: var(--nearbyyou-pink);
}

/* Location Buttons */
.nearbyyou-tma-location-buttons {
    display: flex;
    gap: 10px;
}

.nearbyyou-tma-btn-location {
    flex: 1;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nearbyyou-pink);
    background: #fff0f7;
    border: 2px solid var(--nearbyyou-pink);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nearbyyou-tma-btn-location:hover {
    background: var(--nearbyyou-pink);
    color: #ffffff;
}

.nearbyyou-tma-btn-location:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle */
.nearbyyou-tma-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.nearbyyou-tma-toggle input[type="checkbox"] {
    width: 48px;
    height: 28px;
    appearance: none;
    background: #d0d0d0;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.nearbyyou-tma-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nearbyyou-tma-toggle input[type="checkbox"]:checked {
    background: var(--nearbyyou-pink);
}

.nearbyyou-tma-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

/* Go Button */
.nearbyyou-tma-btn-go {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    background: var(--nearbyyou-pink);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.nearbyyou-tma-btn-go:hover {
    background: var(--nearbyyou-pink-dark);
    transform: translateY(-2px);
}

/* Card Deck */
.nearbyyou-tma-deck {
    position: relative;
    width: 100%;
    height: 560px;
    padding: 16px;
}

.nearbyyou-tma-card-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Individual Card */
.nearbyyou-tma-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    cursor: grab;
    transition: transform 0.3s ease, opacity 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.nearbyyou-tma-card.dragging {
    cursor: grabbing;
    transition: none;
}

.nearbyyou-tma-card.swiped-left {
    transform: translateX(-150%) rotate(-30deg);
    opacity: 0;
}

.nearbyyou-tma-card.swiped-right {
    transform: translateX(150%) rotate(30deg);
    opacity: 0;
}

/* Card stacking effect */
.nearbyyou-tma-card:nth-child(2) {
    transform: scale(0.95);
    z-index: -1;
}

.nearbyyou-tma-card:nth-child(3) {
    transform: scale(0.9);
    z-index: -2;
}

/* Card Image */
.nearbyyou-tma-card-image {
    width: 100%;
    height: 58%;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Swipe Indicators */
.nearbyyou-tma-swipe-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.nearbyyou-tma-swipe-indicator.nope {
    left: 16px;
    background: rgba(255, 0, 0, 0.9);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
}

.nearbyyou-tma-swipe-indicator.like {
    right: 16px;
    background: rgba(0, 200, 0, 0.9);
    box-shadow: 0 0 30px rgba(0, 200, 0, 0.6);
}

.nearbyyou-tma-card.dragging .nearbyyou-tma-swipe-indicator.nope {
    opacity: var(--nope-opacity, 0);
}

.nearbyyou-tma-card.dragging .nearbyyou-tma-swipe-indicator.like {
    opacity: var(--like-opacity, 0);
}

/* Badge */
.nearbyyou-tma-card-badge {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 7px 12px;
    background: rgba(220, 8, 102, 0.96);
    color: #ffffff;
    font-size: clamp(10px, 2.2vw, 12px);
    font-weight: 800;
    border-radius: 999px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    max-width: 85%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card Content */
.nearbyyou-tma-card-content {
    padding: 20px;
    height: 42%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nearbyyou-tma-card-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nearbyyou-tma-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.nearbyyou-tma-card-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Rating */
.nearbyyou-tma-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}

.nearbyyou-tma-stars {
    display: flex;
    gap: 2px;
}

.nearbyyou-tma-star {
    color: #ffa500;
    font-size: 15px;
}

/* Action Buttons */
.nearbyyou-tma-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.nearbyyou-tma-action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nearbyyou-tma-action-btn:hover {
    transform: scale(1.1);
}

.nearbyyou-tma-action-btn:active {
    transform: scale(0.95);
}

.nearbyyou-tma-btn-nope {
    background: #ff4458;
    color: #ffffff;
}

.nearbyyou-tma-btn-shuffle {
    background: #f0f0f0;
    color: var(--nearbyyou-pink);
    font-size: 22px;
}

.nearbyyou-tma-btn-like {
    background: #00d37f;
    color: #ffffff;
}

/* Loading */
.nearbyyou-tma-loading {
    padding: 60px 24px;
    text-align: center;
}

.nearbyyou-tma-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--nearbyyou-pink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.nearbyyou-tma-empty {
    padding: 50px 24px;
    text-align: center;
}

.nearbyyou-tma-empty-icon {
    font-size: 70px;
    margin-bottom: 16px;
}

.nearbyyou-tma-empty h3 {
    font-size: 20px;
    margin: 0 0 10px 0;
}

.nearbyyou-tma-empty p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .nearbyyou-tma-modal-container {
        padding: 0;
        align-items: flex-end;
    }
    
    .nearbyyou-tma-modal-content {
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        max-width: 100%;
    }
    
    .nearbyyou-tma-logo-header {
        padding: 16px;
    }
    
    .nearbyyou-tma-logo {
        max-width: 150px;
    }
    
    .nearbyyou-tma-filters {
        padding: 20px 16px;
    }
    
    .nearbyyou-tma-deck {
        height: 480px;
        padding: 12px;
    }
    
    .nearbyyou-tma-category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .nearbyyou-tma-category-card {
        padding: 14px 6px;
        min-height: 90px;
    }
    
    .nearbyyou-tma-category-icon {
        font-size: 28px;
    }
    
    .nearbyyou-tma-category-label {
        font-size: 11px;
    }
    
    .nearbyyou-tma-card-title {
        font-size: 20px;
    }
    
    .nearbyyou-tma-card-content {
        padding: 16px;
    }
    
    .nearbyyou-tma-card-meta {
        font-size: 12px;
    }
    
    .nearbyyou-tma-card-excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .nearbyyou-tma-action-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .nearbyyou-tma-swipe-indicator {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
}

@media (max-width: 380px) {
    .nearbyyou-tma-deck {
        height: 420px;
    }
    
    .nearbyyou-tma-category-card {
        min-height: 80px;
    }
    
    .nearbyyou-tma-card-title {
        font-size: 18px;
    }
}

/* High resolution screens */
@media (min-width: 641px) and (max-width: 1024px) {
    .nearbyyou-tma-modal-content {
        max-width: 540px;
    }
    
    .nearbyyou-tma-deck {
        height: 580px;
    }
}

/* Accessibility improvements */
.nearbyyou-tma-action-btn:focus,
.nearbyyou-tma-btn-go:focus,
.nearbyyou-tma-select:focus,
.nearbyyou-tma-btn-location:focus {
    outline: 3px solid var(--nearbyyou-pink);
    outline-offset: 2px;
}

/* Smooth scrolling for filter screen */
.nearbyyou-tma-filters::-webkit-scrollbar {
    width: 6px;
}

.nearbyyou-tma-filters::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.nearbyyou-tma-filters::-webkit-scrollbar-thumb {
    background: var(--nearbyyou-pink);
    border-radius: 3px;
}

.nearbyyou-tma-filters::-webkit-scrollbar-thumb:hover {
    background: var(--nearbyyou-pink-dark);
}