/**
 * MTI 2025 Tools CSS
 */

/* Tag Filters - Minimalist Style */
.mti-tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tag-filter {
    color: var(--dark-gray, #666);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 4px 2px;
    position: relative;
}

.tag-filter:hover {
    color: var(--primary, #9F1438);
}

.tag-filter.active {
    color: var(--primary, #9F1438);
    font-weight: 600;
}

.tag-filter.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary, #9F1438);
}

/* Main container */
.mti-tools-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Tools Grid Layout */
.mti-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* Special handling for expanded state with few items */
.mti-tools-grid.has-expanded-item {
    grid-template-rows: auto auto;
}

.mti-tool-card {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 5/3;
}

.mti-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.mti-tool-categories {
    color: #ccc;
}

/* Background icon (for when no image is set) */
.mti-tool-bg-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Style specifically for icon fallbacks */
.mti-tool-bg-icon > i,
.mti-tool-bg-icon > svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
    font-size: 120px;
    color: var(--dark-gray);
    text-align: center;
}

/* Style for image backgrounds */
.mti-tool-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.mti-tool-thumbnail img {
    width: 100%;
    height: 100%!important;
    object-fit: cover;
    opacity: 0.7; 
    transition: opacity 0.3s ease;
}

/* Title bar at the bottom */
.mti-tool-title-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 1);
    padding: 15px;
    border-top: 1px solid var(--border);
    z-index: 3;
}

.mti-tool-title {
    font-size: 1rem!important;
    margin: 0;
    color: var(--dark);
    text-align: center;
}

/* Hidden content - only for admin panel */
.mti-tool-content {
    display: none;
}

/* Special styles for featured tools */
.mti-tool-card.featured {
    box-shadow: 0 4px 12px rgba(159, 20, 56, 0.2);
    border: 1px solid var(--primary-lighter);
}

.mti-tool-card.featured:hover {
    box-shadow: 0 8px 20px rgba(159, 20, 56, 0.3);
}

.mti-tool-card.featured .mti-tool-title-bar {
    background-color: rgba(255, 255, 255, 0.95);
    border-top: 2px solid var(--primary);
}

.mti-tool-card.featured .mti-tool-title {
    color: var(--primary);
}

/* Featured tool images */
.mti-tool-card.featured .mti-tool-thumbnail img {
    opacity: 0.8;
}

.mti-tool-card.featured:hover .mti-tool-thumbnail img {
    opacity: 0.9;
}

/* Adding a subtle indicator for new tools */
.mti-tool-card .new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary);
    color: white;
    font-size: 12px;
    padding: 4px 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 3;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Subtle indication for cards with slideout */
.has-details-indicator {
    /* You can add styles here if needed */
}

.featured .has-details-indicator {
    background-color: var(--primary-lighter);
    color: var(--primary);
}

/* Hover effects */
.mti-tool-card:hover .mti-tool-thumbnail img {
    opacity: 0.9;
}

/* Tool Expander/Slideout */
.mti-tool-expander {
    grid-column: 1 / -1;
    width: 100%;
    background: #fff;
    overflow: hidden;
    height: 0;
    transition: height 0.35s ease;
    margin-top: 20px;
    border: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    position: relative;
    z-index: 100;
}

.mti-tool-expander-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 30px;
    position: relative;
}

.mti-tool-card.expanded {
    z-index: 1000;
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.mti-tool-card.featured.expanded {
    box-shadow: 0 8px 20px rgba(159, 20, 56, 0.3);
}

.mti-tool-details-content {
    display: none;
}

.mti-tool-expander .details {
    color: var(--dark);
}

.mti-tool-expander .details h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.mti-tool-expander .details p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.mti-tool-expander .details img {
    float: right;
    margin: 0 0 1em 1em;
    max-width: 40%;
    height: auto;
}

.close-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 24px;
    line-height: 32px;
    text-align: center;
    color: var(--dark-gray);
    transition: all 0.2s;
}

.close-icon:hover {
    background: var(--light-gray);
    color: white;
}

/* Link reference in slideout */
.mti-tool-link-reference {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    color: var(--medium-gray);
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
    .mti-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mti-tools-container {
        padding: 15px;
    }
    
    .mti-tool-expander-inner {
        padding: 30px 20px;
    }
    
    .mti-tag-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .mti-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .mti-tool-expander-inner {
        padding: 25px 15px;
    }
    
    .mti-tag-filters {
        padding-bottom: 10px;
    }
}