/**
 * Taxonomy Icon Box Widget Styles
 * 
 * @package ProStoneManager
 * @since 2.5.0
 */

/* ============================================
   Icon Box Container
   ============================================ */

.psm-taxonomy-icon-boxes-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.psm-taxonomy-icon-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: none !important;
    border-radius: 0 !important;
    padding: 20px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    cursor: default;
}

/* Clickable box with popup */
.psm-taxonomy-icon-box.psm-has-popup {
    cursor: pointer;
    user-select: none;
}

.psm-taxonomy-icon-box.psm-has-popup:hover {
    transform: translateY(-3px);
}

.psm-taxonomy-icon-box.psm-has-popup:active {
    transform: translateY(-1px);
}

/* No terms fallback */
.psm-taxonomy-icon-box.psm-no-terms {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   Icon
   ============================================ */

.psm-tax-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.psm-tax-icon img {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* ============================================
   Term Name (V3, P5, etc.)
   ============================================ */

.psm-tax-term-name {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
    line-height: 1.2;
}

/* ============================================
   Taxonomy Label (Colour Variations, Slip Ratings)
   ============================================ */

.psm-tax-label {
    font-size: 12px;
    font-weight: 400;
    color: #666666;
    line-height: 1.3;
    text-transform: capitalize;
    white-space: nowrap;
}

/* ============================================
   Fallback Message
   ============================================ */

.psm-tax-fallback {
    font-size: 14px;
    color: #999999;
    font-style: italic;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .psm-taxonomy-icon-boxes-wrapper {
        gap: 10px;
    }
    
    .psm-taxonomy-icon-box {
        padding: 15px;
    }
    
    .psm-tax-icon img {
        width: 50px;
        height: 50px;
    }
    
    .psm-tax-term-name {
        font-size: 16px;
    }
    
    .psm-tax-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .psm-taxonomy-icon-box {
        padding: 12px;
    }
    
    .psm-tax-icon img {
        width: 40px;
        height: 40px;
    }
    
    .psm-tax-term-name {
        font-size: 14px;
    }
    
    .psm-tax-label {
        font-size: 10px;
    }
}

/* ============================================
   Hover Effects (when popup enabled)
   ============================================ */

.psm-taxonomy-icon-box.psm-has-popup {
    position: relative;
    overflow: hidden;
}

/* Subtle shine effect on hover */
.psm-taxonomy-icon-box.psm-has-popup::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.psm-taxonomy-icon-box.psm-has-popup:hover::before {
    opacity: 1;
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Popup click indicator */
.psm-taxonomy-icon-box.psm-has-popup::after {
    content: '\f05a'; /* FontAwesome info-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    color: #0073aa;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.psm-taxonomy-icon-box.psm-has-popup:hover::after {
    opacity: 0.7;
}

/* ============================================
   Editor Preview
   ============================================ */

.psm-editor-notice {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
}

/* ============================================
   RTL Support
   ============================================ */

[dir="rtl"] .psm-taxonomy-icon-box.psm-has-popup::after {
    right: auto;
    left: 8px;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .psm-taxonomy-icon-box.psm-has-popup::after {
        display: none;
    }
    
    .psm-taxonomy-icon-box {
        break-inside: avoid;
    }
}
