/* ============================================
   Long Island Today - Social Features CSS
   Bookmarks, Comments, Events, Recently Viewed
   ============================================ */

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.lit-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: var(--white);
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.lit-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   BOOKMARK BUTTONS
   ============================================ */
.bookmark-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.bookmark-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.bookmark-btn.active {
    background: #fee2e2;
}

.bookmark-icon {
    line-height: 1;
}

/* Saved Nav Link */
.saved-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bookmark-count {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    min-width: 18px;
    text-align: center;
}

/* ============================================
   COMMENTS SECTION
   ============================================ */
.comments-section {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 2px solid var(--gray-200);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.comments-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.comments-count-badge {
    background: var(--primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
}

.comments-sort {
    display: flex;
    gap: 8px;
}

.sort-btn {
    padding: 8px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 50px;
    background: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.sort-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sort-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Comment Form */
.comment-form {
    background: var(--gray-50);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
}

.comment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .comment-form-row {
        grid-template-columns: 1fr;
    }
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 106, 51, 0.15);
}

.comment-form textarea {
    resize: vertical;
    min-height: 100px;
    margin-bottom: 16px;
}

.comment-form .btn {
    width: 100%;
}

@media (min-width: 600px) {
    .comment-form .btn {
        width: auto;
    }
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.no-comments {
    text-align: center;
    color: var(--gray-500);
    padding: 40px 20px;
    font-size: 1rem;
}

.comment-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    transition: box-shadow 0.2s;
}

.comment-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #f59e0b 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: var(--gray-900);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.comment-text {
    color: var(--gray-700);
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.comment-actions {
    display: flex;
    gap: 16px;
}

.comment-like-btn,
.comment-reply-btn {
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.comment-like-btn:hover,
.comment-reply-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.comment-like-btn.liked {
    color: #ef4444;
}

.like-count {
    font-weight: 600;
}

/* ============================================
   EVENT INTEREST BUTTONS
   ============================================ */
.event-interest-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.event-interest-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.interest-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.interest-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.interest-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.interest-btn.active {
    background: rgba(232, 106, 51, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.interest-btn.going.active {
    background: #dcfce7;
    border-color: #22c55e;
    color: #16a34a;
}

.interest-icon {
    font-size: 1.1rem;
}

.interest-count {
    font-size: 0.8rem;
    opacity: 0.8;
}

.interest-stats {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-align: center;
    margin: 0 0 16px 0;
}

.calendar-btn {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-btn:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================
   RECENTLY VIEWED SECTION
   ============================================ */
.recently-viewed-section {
    background: var(--gray-50);
    padding: 48px 0;
}

.recently-viewed-section::before {
    display: none;
}

.clear-history-btn {
    padding: 8px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 50px;
    background: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.clear-history-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.recently-viewed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.recently-viewed-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.recently-viewed-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.rv-image {
    height: 140px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.rv-type {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.rv-content {
    padding: 16px;
}

.rv-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rv-time {
    font-size: 0.8rem;
    color: var(--gray-400);
}

/* ============================================
   NEWSLETTER POPUP
   ============================================ */
.newsletter-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.newsletter-popup-overlay.visible {
    opacity: 1;
}

.newsletter-popup {
    background: var(--white);
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.newsletter-popup-overlay.visible .newsletter-popup {
    transform: scale(1) translateY(0);
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.popup-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.popup-content {
    padding: 48px 32px 32px;
    text-align: center;
}

.popup-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.popup-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.popup-content > p {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 24px;
}

.popup-benefits {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--gray-700);
}

.popup-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-form input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.popup-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 106, 51, 0.15);
}

.popup-form .btn {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
}

.popup-note {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--gray-400);
}

.popup-success {
    padding: 48px 32px;
    text-align: center;
}

.popup-success h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin: 16px 0 12px;
}

.popup-success p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

/* ============================================
   SAVED PAGE STYLES
   ============================================ */
.saved-page-header {
    text-align: center;
    padding: 48px 0;
    background: linear-gradient(135deg, var(--white) 0%, var(--primary-lighter) 100%);
}

.saved-page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.saved-page-header p {
    color: var(--gray-600);
    font-size: 1.1rem;
}

.saved-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.saved-tab {
    padding: 10px 20px;
    border: 1px solid var(--gray-200);
    border-radius: 50px;
    background: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.saved-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.saved-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.saved-content {
    padding: 48px 0;
    min-height: 400px;
}

.saved-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.saved-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-500);
}

.saved-empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.saved-empty h3 {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.saved-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    position: relative;
}

.saved-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.saved-card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.saved-card-type {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.saved-card-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-600);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-card-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

.saved-card-content {
    padding: 20px;
}

.saved-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
    line-height: 1.3;
}

.saved-card-meta {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 12px;
}

.saved-card-time {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 12px;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    .lit-toast {
        background: var(--gray-100);
        color: var(--gray-900);
    }
    
    .bookmark-btn {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .bookmark-btn.active {
        background: rgba(127, 29, 29, 0.5);
    }
    
    .comment-form {
        background: var(--gray-100);
    }
    
    .comment-card {
        background: var(--gray-100);
        border-color: var(--gray-200);
    }
    
    .newsletter-popup {
        background: var(--gray-100);
    }
    
    .newsletter-popup h2 {
        color: var(--white);
    }
    
    .recently-viewed-card,
    .saved-card {
        background: var(--gray-100);
    }
}

/* ============================================
   MOBILE ADJUSTMENTS
   ============================================ */
@media (max-width: 640px) {
    .comments-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-card {
        flex-direction: column;
        gap: 12px;
    }
    
    .comment-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .popup-content {
        padding: 40px 24px 24px;
    }
    
    .recently-viewed-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .rv-image {
        height: 100px;
    }
    
    .rv-content {
        padding: 12px;
    }
    
    .rv-content h3 {
        font-size: 0.875rem;
    }
}
