/**
 * Taxonomy Grid Widget Styles - Monochrome Neon Edition
 * Creative Minimal Design with White/Gray Neon Effects
 * 
 * @package ProStoneManager
 * @since 2.5.0
 */

/* ==========================================
   BASE WRAPPER
   ========================================== */

.psm-taxonomy-grid-wrapper {
    position: relative;
    width: 100%;
    padding: 60px 0;
    background: transparent;
}

/* ==========================================
   GRID LAYOUT
   ========================================== */

.psm-taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    position: relative;
    z-index: 1;
}

/* Stagger Animation */
.psm-taxonomy-grid .psm-tax-item {
    animation: itemFadeIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.psm-taxonomy-grid .psm-tax-item:nth-child(1) { animation-delay: 0.05s; }
.psm-taxonomy-grid .psm-tax-item:nth-child(2) { animation-delay: 0.1s; }
.psm-taxonomy-grid .psm-tax-item:nth-child(3) { animation-delay: 0.15s; }
.psm-taxonomy-grid .psm-tax-item:nth-child(4) { animation-delay: 0.2s; }
.psm-taxonomy-grid .psm-tax-item:nth-child(5) { animation-delay: 0.25s; }
.psm-taxonomy-grid .psm-tax-item:nth-child(6) { animation-delay: 0.3s; }
.psm-taxonomy-grid .psm-tax-item:nth-child(7) { animation-delay: 0.35s; }
.psm-taxonomy-grid .psm-tax-item:nth-child(8) { animation-delay: 0.4s; }
.psm-taxonomy-grid .psm-tax-item:nth-child(9) { animation-delay: 0.45s; }
.psm-taxonomy-grid .psm-tax-item:nth-child(10) { animation-delay: 0.5s; }
.psm-taxonomy-grid .psm-tax-item:nth-child(n+11) { animation-delay: 0.55s; }

@keyframes itemFadeIn {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.9);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Responsive Grid */
@media (min-width: 1920px) {
    .psm-taxonomy-grid { grid-template-columns: repeat(10, 1fr); }
}

@media (min-width: 1600px) and (max-width: 1919px) {
    .psm-taxonomy-grid { grid-template-columns: repeat(8, 1fr); }
}

@media (min-width: 1440px) and (max-width: 1599px) {
    .psm-taxonomy-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 1280px) and (max-width: 1439px) {
    .psm-taxonomy-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .psm-taxonomy-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .psm-taxonomy-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

@media (min-width: 640px) and (max-width: 767px) {
    .psm-taxonomy-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 639px) {
    .psm-taxonomy-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .psm-taxonomy-grid-wrapper {
        padding: 30px 0;
    }
}

/* ==========================================
   TAXONOMY ITEM CARD - CREATIVE NEON
   ========================================== */

.psm-tax-item {
    position: relative;
    height: 450px;
    border-radius: 18px;
    overflow: visible; /* Allow count to overflow outside */
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

/* Animated Neon Border - White/Gray Gradient */
.psm-tax-item::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(
        45deg,
        #ffffff00,
        #d1d5db00,
        #9ca3af00,
        #6b728000,
        #ffffff00
    );
    background-size: 400% 400%;
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    animation: neonFlow 4s ease-in-out infinite;
    transition: opacity 0.5s ease;
    filter: blur(8px);
}

@keyframes neonFlow {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

.psm-tax-item:hover::before {
    opacity: 0.8;
}

/* Glowing Edge Effect */
.psm-tax-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(45deg, #ffffff, #e5e7eb, #d1d5db, #ffffff);
    -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.5s ease;
}

.psm-tax-item:hover::after {
    opacity: 0.6;
    animation: edgeGlow 2s ease-in-out infinite;
}

@keyframes edgeGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
}

/* Hover Transform */
.psm-tax-item:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(255, 255, 255, 0.1),
        inset 0 0 60px rgba(255, 255, 255, 0.05);
}

/* Link Wrapper */
.psm-tax-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

/* ==========================================
   IMAGE SECTION WITH CREATIVE OVERLAY
   ========================================== */

.psm-tax-image-wrap {
    position: relative;
    width: 100%;
    height: 100% !important;
    overflow: hidden;
    border-radius: 12px; /* Match card border-radius */
    background: #000;
}

.psm-tax-image {
    width: 100%;
    height: 100% !important; 
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: grayscale(30%) brightness(0.8);
}

.psm-tax-item:hover .psm-tax-image {
    transform: scale(1.15) rotate(2deg);
    filter: grayscale(0%) brightness(0.6);
}

/* ==========================================
   TITLE STYLING
   ========================================== */

/* Info Container for Title */
.psm-tax-info {
    position: absolute;
    bottom: 25px;
    left: 20px;
    right: 20px;
    padding: 18px 25px;
    text-align: left;
    z-index: 10;
    pointer-events: none;
    border-radius: 12px;
}

/* Title - Clean & Compact */
.psm-tax-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
    display: inline-block;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Title Hover Effect - Enhanced Glow */
.psm-tax-item:hover .psm-tax-title {
    letter-spacing: 3.5px;
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.9),
        0 0 30px rgba(255, 255, 255, 0.6),
        0 0 45px rgba(255, 255, 255, 0.4),
        0 2px 10px rgba(0, 0, 0, 0.6);
    transform: translateX(3px);
}

/* Animated Underline - Appears on Hover */
.psm-tax-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        #ffffff 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.psm-tax-item:hover .psm-tax-title::after {
    width: 100%;
}

/* ==========================================
   COUNT NUMBER - SIMPLE TEXT ONLY
   ========================================== */

/* Count Number - Plain Text, No Background */
.psm-tax-count {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(-15px) scale(0.8);
    z-index: 200; /* Highest priority - above everything */
    
    /* Simple Text Only */
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 255, 255, 0.3);
    
    /* No Background, No Border, No Badge */
    background: none;
    border: none;
    padding: 0;
    
    /* Hidden by default */
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Remove all pseudo elements */
.psm-tax-count::before,
.psm-tax-count::after {
    display: none;
}

/* Count Number - Animated Entry on Hover */
.psm-tax-item:hover .psm-tax-count {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* ==========================================
   MAGNETIC HOVER EFFECT
   ========================================== */

.psm-hover-magnetic .psm-tax-item {
    will-change: transform;
}

/* Corner Accent - Minimal Brackets */
.psm-tax-info::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.4);
    border-right: 2px solid rgba(255, 255, 255, 0.4);
    opacity: 0;
    transform: translate(10px, -10px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.psm-tax-item:hover .psm-tax-info::after {
    opacity: 1;
    transform: translate(0, 0);
}

/* ==========================================
   LOADING STATE
   ========================================== */

.psm-tax-item.loading .psm-tax-image-wrap {
    background: linear-gradient(
        90deg,
        #1a1a1a 0%,
        #2a2a2a 50%,
        #1a1a1a 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

.psm-tax-link:focus {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

.psm-tax-link:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .psm-tax-item,
    .psm-tax-image,
    .psm-tax-overlay,
    .psm-tax-info,
    .psm-tax-title,
    .psm-tax-item::before,
    .psm-tax-item::after {
        animation: none !important;
        transition: none !important;
    }
}
