/**
 * Enhanced Event Cards Styles
 * Ensures proper styling for all interactive elements
 */

/* Event Card Base Styles */
.event-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    margin-bottom: 16px;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.event-card.touched {
    transform: scale(0.98);
}

.event-card.highlighted {
    box-shadow: 0 0 0 3px #8C1515;
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0%, 100% { box-shadow: 0 0 0 3px #8C1515; }
    50% { box-shadow: 0 0 0 6px rgba(140, 21, 21, 0.4); }
}

/* Image Container */
.event-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.event-card:hover .event-image {
    transform: scale(1.05);
}

/* Badges */
.tonight-badge, .ai-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    z-index: 2;
}

.tonight-badge {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}

.ai-badge {
    background: linear-gradient(45deg, #667eea, #764ba2);
    top: 12px;
    left: 12px;
}

/* Save Button Overlay */
.save-button-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}

.save-btn {
    background: rgba(0,0,0,0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-btn:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

.save-btn.saved {
    background: #8C1515;
    color: white;
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Event Content */
.event-content {
    padding: 20px;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.event-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    flex: 1;
    margin-right: 12px;
}

.time-until {
    background: #f8f9fa;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Event Details */
.event-details {
    margin-bottom: 16px;
}

.event-details > div {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6c757d;
}

.event-details i {
    width: 16px;
    margin-right: 8px;
    color: #8C1515;
}

.event-location {
    position: relative;
}

.directions-btn {
    background: none;
    border: none;
    color: #8C1515;
    font-size: 12px;
    margin-left: 8px;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.directions-btn:hover {
    background-color: rgba(140, 21, 21, 0.1);
}

.attendance-count {
    font-weight: 600;
    color: #2c3e50;
}

/* Event Description */
.event-description {
    color: #495057;
    line-height: 1.5;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Vibe Tags */
.event-vibes {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vibe-tag {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #dee2e6;
}

/* Event Actions */
.event-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.event-actions button {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.event-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.event-actions button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.event-actions button:active:not(:disabled) {
    transform: translateY(0);
}

/* RSVP Button */
.rsvp-btn {
    background: linear-gradient(45deg, #8C1515, #a91e1e);
    color: white;
}

.rsvp-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #a91e1e, #8C1515);
}

.rsvp-btn.rsvpd {
    background: linear-gradient(45deg, #28a745, #34ce57);
}

.rsvp-btn.rsvpd:hover:not(:disabled) {
    background: linear-gradient(45deg, #1e7e34, #28a745);
}

/* Website Button */
.website-btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
}

.website-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #0056b3, #007bff);
}

/* Share Button */
.share-btn {
    background: linear-gradient(45deg, #17a2b8, #138496);
    color: white;
}

.share-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #138496, #17a2b8);
}

/* Calendar Button */
.calendar-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.calendar-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #20c997, #28a745);
}

/* Details Button */
.details-btn {
    background: linear-gradient(45deg, #6f42c1, #563d7c);
    color: white;
}

.details-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #563d7c, #6f42c1);
}

/* AI Note */
.ai-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-radius: 6px;
    border-left: 3px solid #667eea;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.ai-note i {
    color: #667eea;
}

/* Share Modal */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.share-modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    min-width: 300px;
    max-width: 500px;
    width: 90%;
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.share-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background: #f8f9fa;
}

.share-url {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.share-url input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.share-url button {
    padding: 8px 16px;
    background: #8C1515;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.share-url button:hover {
    background: #a91e1e;
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-buttons a {
    flex: 1;
    padding: 10px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.share-buttons a:hover {
    transform: translateY(-2px);
}

.share-twitter {
    background: #1da1f2;
    color: white;
}

.share-facebook {
    background: #4267B2;
    color: white;
}

.share-email {
    background: #6c757d;
    color: white;
}

/* Enhanced States */
.event-card.rsvpd {
    border-left: 4px solid #28a745;
}

.event-card.saved {
    border-right: 4px solid #8C1515;
}

.event-card.ai-enhanced {
    background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .event-actions {
        flex-direction: column;
    }
    
    .event-actions button {
        min-width: auto;
        width: 100%;
    }
    
    .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .time-until {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .event-content {
        padding: 16px;
    }
    
    .event-title {
        font-size: 16px;
    }
    
    .share-modal {
        margin: 20px;
        width: calc(100% - 40px);
    }
}

/* Loading States */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8C1515;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Accessibility */
.event-card:focus-within {
    outline: 2px solid #8C1515;
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid #8C1515;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .event-actions {
        display: none;
    }
    
    .save-button-overlay {
        display: none;
    }
    
    .event-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
