/* ============================================================
   Home Page Styles - MyKoi
   Extracted from livewire/home.blade.php
   ============================================================ */

/* ============================================================
   Skeleton Loader
   ============================================================ */
.skeleton-box {
    position: relative;
    overflow: hidden;
    background: rgba(75, 85, 99, 0.35);
    border-radius: 4px;
}

.skeleton-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.07) 50%, transparent 100%);
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Stat card skeleton */
.skeleton-stat {
    border-radius: 8px;
    padding: 1rem;
    background: rgba(55, 65, 81, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Event list item skeleton */
.skeleton-event {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(55, 65, 81, 0.25);
}

/* Koi card skeleton (vertical card) */
.skeleton-koi {
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: rgba(55, 65, 81, 0.4);
    min-width: 110px;
    width: 110px;
}

@media (min-width: 768px) {
    .skeleton-koi {
        width: auto;
        min-width: unset;
    }
}

/* Farm card skeleton */
.skeleton-farm {
    border-radius: 8px;
    padding: 1rem;
    background: rgba(55, 65, 81, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* Cursor styles */
.event-card,
.content-card {
    cursor: pointer !important;
}

/* Event detail text */
.event-detail {
    font-size: 70%;
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

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

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

.animate-on-scroll {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* ============================================================
   Statistics Card Styles
   ============================================================ */
.stat-card {
    transition: box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    transition: none;
}

/* ============================================================
   Content Card Styles
   ============================================================ */
.content-card {
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    position: relative;
}

.content-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

a:hover .content-card h3 {
    color: #ff4242;
}

.content-card img {
    border-radius: 4px;
}

.content-card h3 a {
    transition: color 0.3s ease;
    position: relative;
    display: inline-block;
}

/* ============================================================
   Event Card Styles
   ============================================================ */
.event-card {
    transition: box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    gap: 0.25rem;
}

.event-card:hover:not(.opacity-75) {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.event-card img {
    border-radius: 4px;
}

.event-card h3 {
    transition: color 0.3s ease;
}

.event-card:hover:not(.opacity-75) h3 {
    color: #ff4242;
}

/* ============================================================
   Section Title Styles
   ============================================================ */
.section-title {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(135deg, rgba(65, 65, 65, 0.95) 0%, rgba(45, 45, 45, 0.95) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid rgba(255, 66, 66, 0.5);
}

.section-title h2 {
    display: flex;
    align-items: center;
}

.section-title h2 i {
    margin-right: 8px;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.view-all-link:hover {
    color: #ff4242;
}

/* ============================================================
   Back to Top Button
   ============================================================ */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4242 0%, #e63946 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 100;
    border: none;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    box-shadow: 0 8px 25px rgba(255, 66, 66, 0.4);
}

@media (max-width: 768px) {
    .back-to-top-btn {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
}

/* ============================================================
   Farm Card Styles
   ============================================================ */
.farm-card {
    transition: box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.farm-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.farm-image {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.farm-card:hover .farm-image {
    box-shadow: 0 8px 20px rgba(255, 66, 66, 0.3);
    border-color: #ff4242;
}

.farm-carousel-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 66, 66, 0.8) 0%, rgba(230, 57, 70, 0.8) 100%);
    color: white;
    border: none;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.farm-carousel-btn:hover {
    background: linear-gradient(135deg, #ff4242 0%, #e63946 100%);
    box-shadow: 0 4px 15px rgba(255, 66, 66, 0.4);
}

.farm-carousel-btn i {
    color: white;
}

.farm-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(209, 213, 219, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.farm-carousel-dot:hover {
    background-color: rgba(255, 66, 66, 0.5);
}

.farm-carousel-dot.active {
    background-color: #ff4242;
    box-shadow: 0 0 10px rgba(255, 66, 66, 0.5);
}

/* ============================================================
   Koi Carousel Button Styles
   ============================================================ */
.koi-carousel-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 66, 66, 0.8) 0%, rgba(230, 57, 70, 0.8) 100%);
    color: white;
    border: none;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.koi-carousel-btn:hover {
    background: linear-gradient(135deg, #ff4242 0%, #e63946 100%);
    box-shadow: 0 4px 15px rgba(255, 66, 66, 0.4);
}

.koi-carousel-btn i {
    color: white;
}

/* ============================================================
   Koi Grid - Mobile: Horizontal scrollable layout
   ============================================================ */
@media (max-width: 767px) {
    .koi-grid-container {
        display: flex;
        gap: 0.75rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        scroll-behavior: smooth;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 66, 66, 0.5) rgba(55, 65, 81, 0.3);
    }

    .koi-grid-container::-webkit-scrollbar {
        height: 6px;
    }

    .koi-grid-container::-webkit-scrollbar-track {
        background: rgba(55, 65, 81, 0.3);
        border-radius: 10px;
    }

    .koi-grid-container::-webkit-scrollbar-thumb {
        background: rgba(255, 66, 66, 0.5);
        border-radius: 10px;
    }

    .koi-grid-container::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 66, 66, 0.7);
    }

    .koi-card {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 0.5rem;
        transition: all 0.2s ease;
        text-decoration: none;
        width: 150px;
        min-width: 150px;
        flex-shrink: 0;
    }

    .koi-card:hover {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .koi-image-wrapper {
        width: 100%;
        aspect-ratio: 2/3;
        border-radius: 0.5rem;
        overflow: hidden;
        background: #4b5563;
        position: relative;
    }

    .koi-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        max-width: 150px;
    }

    .koi-age-badge {
        position: absolute;
        bottom: 4px;
        right: 4px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 2px 4px;
        border-radius: 3px;
        font-size: 0.65rem;
        font-weight: 600;
        display: block;
        z-index: 10;
    }

    .koi-hover-overlay {
        display: none;
    }

    .koi-content {
        padding: 0.5rem;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .koi-title {
        margin-bottom: 0.25rem;
        overflow: hidden;
        min-width: 0;
    }

    .koi-title h3 {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        max-width: 100% !important;
    }

    .koi-info {
        display: flex;
        flex-direction: column;
        gap: 0.125rem;
        font-size: 0.7rem;
        color: #d1d5db;
        min-width: 0;
    }

    .koi-info p {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        max-width: 100% !important;
    }
}

/* ============================================================
   Koi Grid - Tablet+: Vertical card layout (image top, info bottom)
   ============================================================ */
@media (min-width: 768px) {
    .koi-grid-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .koi-card {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 0.5rem;
        transition: all 0.2s ease;
        text-decoration: none;
    }

    .koi-card:hover {
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
    }

    .koi-image-wrapper {
        width: 100%;
        aspect-ratio: 2/3;
        background: #4b5563;
        position: relative;
        overflow: hidden;
    }

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

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

    .koi-age-badge {
        position: absolute;
        bottom: 8px;
        right: 8px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.75rem;
        font-weight: 600;
        display: block;
        z-index: 10;
    }

    .koi-hover-overlay {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(0, 0, 0, 0);
        transition: all 0.3s ease;
        opacity: 0;
    }

    .koi-card:hover .koi-hover-overlay {
        background-color: rgba(0, 0, 0, 0.2);
        opacity: 1;
    }

    .koi-hover-content {
        text-align: center;
        color: white;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .koi-content {
        padding: 1rem;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .koi-title {
        margin-bottom: 0.5rem;
    }

    .koi-info {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.875rem;
        color: #d1d5db;
    }
}

/* Desktop: 4 columns */
@media (min-width: 1024px) {
    .koi-grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Wide desktop: 5 columns */
@media (min-width: 1280px) {
    .koi-grid-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============================================================
   General Utilities
   ============================================================ */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   Farm Carousel Slide Widths
   ============================================================ */
@media (max-width: 640px) {
    .farm-slide {
        width: 100%;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    .farm-slide {
        width: 50%;
    }
}

@media (min-width: 1024px) {
    .farm-slide {
        width: 33.333333%;
    }
}
