/**
 * Trek Cards Elegant Styling
 * Adds subtle green accents and interactive hover effects
 * Created: June 22, 2025
 */

/* Trek Card Enhanced Styling */
.trek-card-simple,
.trek-card-enhanced {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    height: 100%;
}

/* Subtle green accent stripe */
.trek-card-simple::before,
.trek-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #059669 0%, #10b981 50%, #059669 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

/* Hover Effects */
.trek-card-simple:hover,
.trek-card-enhanced:hover {
    transform: translateY(-8px) !important;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(5, 150, 105, 0.1) !important;
    border-color: rgba(5, 150, 105, 0.2) !important;
}

.trek-card-simple:hover::before,
.trek-card-enhanced:hover::before {
    transform: scaleX(1);
}

/* Activity Badge Enhancement */
.activity-badge {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.activity-badge::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.trek-card-simple:hover .activity-badge::after,
.trek-card-enhanced:hover .activity-badge::after {
    width: 100px;
    height: 100px;
}

/* Title Link Enhancement */
.trek-card-title a {
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

.trek-card-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #059669;
    transition: width 0.3s ease;
}

.trek-card-simple:hover .trek-card-title a,
.trek-card-enhanced:hover .trek-card-title a {
    color: #059669 !important;
}

.trek-card-simple:hover .trek-card-title a::after,
.trek-card-enhanced:hover .trek-card-title a::after {
    width: 100%;
}

/* Location Icon Animation */
.trek-location svg {
    transition: all 0.3s ease;
}

.trek-card-simple:hover .trek-location svg,
.trek-card-enhanced:hover .trek-location svg {
    color: #059669;
    transform: translateY(-2px);
}

/* Difficulty Tag Enhancement */
.difficulty-tag {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.difficulty-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.trek-card-simple:hover .difficulty-tag::before,
.trek-card-enhanced:hover .difficulty-tag::before {
    left: 100%;
}

/* Meta Icons Enhancement */
.distance-info svg,
.duration-info svg {
    transition: all 0.3s ease;
}

.trek-card-simple:hover .distance-info svg,
.trek-card-enhanced:hover .distance-info svg {
    transform: rotate(15deg);
    color: #059669;
}

.trek-card-simple:hover .duration-info svg,
.trek-card-enhanced:hover .duration-info svg {
    transform: rotate(360deg);
    color: #059669;
}

/* Footer Enhancement */
.trek-card-footer {
    position: relative;
    overflow: hidden;
    background: #f9fafb !important;
    transition: background-color 0.3s ease;
}

.trek-card-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trek-card-simple:hover .trek-card-footer::before,
.trek-card-enhanced:hover .trek-card-footer::before {
    opacity: 1;
}

/* View Trail Link Enhancement */
.view-trek-link {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.view-trek-link svg {
    transition: transform 0.3s ease;
}

.trek-card-simple:hover .view-trek-link,
.trek-card-enhanced:hover .view-trek-link {
    color: #047857 !important;
    font-weight: 700;
}

.trek-card-simple:hover .view-trek-link svg,
.trek-card-enhanced:hover .view-trek-link svg {
    transform: translateX(4px);
}

/* Verified Badge Animation */
.verified-badge {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(5, 150, 105, 0);
    }
}

/* Card Border Gradient on Hover */
.trek-card-simple::after,
.trek-card-enhanced::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, #059669, #10b981, #059669);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.trek-card-simple:hover::after,
.trek-card-enhanced:hover::after {
    opacity: 0.5;
}

/* Add subtle pattern overlay on hover */
.trek-card-body {
    position: relative;
    background: 
        radial-gradient(circle at 20% 80%, transparent 50%, rgba(5, 150, 105, 0.02) 50%),
        radial-gradient(circle at 80% 20%, transparent 50%, rgba(16, 185, 129, 0.02) 50%),
        radial-gradient(circle at 40% 40%, transparent 50%, rgba(5, 150, 105, 0.02) 50%);
    background-size: 0 0;
    transition: background-size 0.3s ease;
}

.trek-card-simple:hover .trek-card-body,
.trek-card-enhanced:hover .trek-card-body {
    background-size: 30px 30px;
}

/* Special hover effect for different difficulty levels */
.trek-card-simple:has(.difficulty-tag:contains("Easy")):hover,
.trek-card-enhanced:has(.difficulty-tag:contains("Easy")):hover {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.trek-card-simple:has(.difficulty-tag:contains("Moderate")):hover,
.trek-card-enhanced:has(.difficulty-tag:contains("Moderate")):hover {
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.trek-card-simple:has(.difficulty-tag:contains("Challenging")):hover,
.trek-card-enhanced:has(.difficulty-tag:contains("Challenging")):hover {
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* Loading Animation for Cards */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.trek-card-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Responsive hover adjustments */
@media (hover: hover) {
    /* Only apply hover effects on devices that support hover */
    .trek-card-simple:active,
    .trek-card-enhanced:active {
        transform: scale(0.98);
    }
}

@media (max-width: 768px) {
    /* Reduce hover lift on mobile */
    .trek-card-simple:hover,
    .trek-card-enhanced:hover {
        transform: translateY(-4px) !important;
    }
}

/* Green accent for grid container */
.trek-grid {
    position: relative;
    padding: 1.5rem 0 !important;
}

.trek-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #059669, transparent);
    border-radius: 3px;
}