/* Tools Page Specific Styles */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.tool-card-wrapper {
    perspective: 1000px;
}

.tool-card {
    display: block;
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #eef2f7;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    text-decoration: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border-color: var(--accent);
}

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

.tool-card:hover .tool-fallback-icon {
    transform: scale(1.1) rotate(5deg);
}

.tool-card:hover .tool-badge {
    opacity: 1;
    transform: translateY(0);
}

.tool-image-container {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 12px;
    background: #f8fafc;
}

.tool-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.tool-fallback-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border: 2px solid;
    transition: all 0.3s ease;
}

.tool-fallback-icon.add-icon {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: var(--primary) !important;
}

.tool-info {
    flex: 1;
}

.tool-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.4;
    text-align: center;
}

.tool-description {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 0;
    text-align: center;
}

.tool-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.add-tool-card {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
}

.add-tool-card:hover {
    background: #f1f5f9;
    border-color: var(--primary);
}

.add-tool-card:hover .tool-fallback-icon.add-icon {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* Quick Access */
.quick-access {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eef2f7;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 10px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eef2f7;
    transition: all 0.2s ease;
    height: 100%;
}

.quick-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    border-color: var(--accent);
}

.quick-link-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.quick-link-card span {
    font-weight: 500;
    color: var(--primary);
    font-size: 14px;
}

/* Instruction Steps */
.instruction-step {
    text-align: center;
    padding: 20px 10px;
    color: white;
}

.instruction-step .step-number {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-weight: 600;
    font-size: 18px;
}

.instruction-step h4 {
    color: white;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.instruction-step p {
    opacity: 0.9;
    font-size: 14px;
    margin-bottom: 0;
}

/* Empty State */
.empty-state {
    padding: 60px 20px;
}

.empty-state i {
    opacity: 0.5;
}

/* Search Bar */
.tools-search .input-group {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tools-search .input-group-text {
    border: none;
    padding-left: 20px;
    background: #f8fafc;
}

.tools-search .form-control {
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    background: #f8fafc;
}

.tools-search .form-control:focus {
    box-shadow: none;
    background: white;
}

.tools-search .btn-outline-primary {
    border-radius: 8px;
    padding: 10px 20px;
}

/* No Results Message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.no-results i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.no-results h4 {
    color: #64748b;
    margin-bottom: 10px;
}

.no-results p {
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 992px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
    
    .tool-card {
        padding: 20px;
    }
    
    .tool-image-container {
        height: 100px;
    }
    
    .tool-fallback-icon {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .quick-access .col-md-3 {
        margin-bottom: 15px;
    }
    
    .tool-image-container {
        height: 90px;
    }
}

@media (max-width: 576px) {
    .tools-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .instruction-step {
        margin-bottom: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-item {
        padding: 2rem 0;
    }
    
    .tool-image-container {
        height: 100px;
    }
}

/* Animation pour le chargement */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card-wrapper {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

/* Délai d'animation pour chaque carte */
.tool-card-wrapper:nth-child(1) { animation-delay: 0.1s; }
.tool-card-wrapper:nth-child(2) { animation-delay: 0.15s; }
.tool-card-wrapper:nth-child(3) { animation-delay: 0.2s; }
.tool-card-wrapper:nth-child(4) { animation-delay: 0.25s; }
.tool-card-wrapper:nth-child(5) { animation-delay: 0.3s; }
.tool-card-wrapper:nth-child(6) { animation-delay: 0.35s; }
.tool-card-wrapper:nth-child(7) { animation-delay: 0.4s; }
.tool-card-wrapper:nth-child(8) { animation-delay: 0.45s; }
.tool-card-wrapper:nth-child(9) { animation-delay: 0.5s; }
.tool-card-wrapper:nth-child(10) { animation-delay: 0.55s; }
.tool-card-wrapper:nth-child(11) { animation-delay: 0.6s; }
.tool-card-wrapper:nth-child(12) { animation-delay: 0.65s; }

/* Image loading states */
.tool-image.loading {
    opacity: 0.5;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Tool image error handling */
.tool-image-container.has-error .tool-fallback-icon {
    display: flex !important;
}

.tool-image-container.has-error .tool-image {
    display: none !important;
}