/* Tools Page Styles */

/* Background Decoration */
.tools-bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.tools-blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
    animation: float 20s infinite ease-in-out;
}

.tools-blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.4) 0%, rgba(13, 110, 253, 0) 70%);
    animation-delay: 0s;
}

.tools-blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(111, 66, 193, 0.3) 0%, rgba(111, 66, 193, 0) 70%);
    animation-delay: -5s;
}

.tools-blob-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(25, 135, 84, 0.2) 0%, rgba(25, 135, 84, 0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -50px) rotate(10deg); }
    66% { transform: translate(-20px, 20px) rotate(-5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* Card animations and hover effects */
.tools-grid .card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tools-grid .card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

[data-bs-theme="dark"] .tools-grid .card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Card link styles */
.tools-grid .card .stretched-link {
    text-decoration: none;
    transition: color 0.2s ease;
}

.tools-grid .card:hover .stretched-link {
    color: var(--bs-primary) !important;
}

/* Light theme - card backgrounds */
[data-bs-theme="light"] .card,
:root:not([data-bs-theme]) .card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    color: #212529; /* Explicitly set dark text color */
}

[data-bs-theme="light"] .card .text-muted,
[data-bs-theme="light"] .card .text-secondary,
:root:not([data-bs-theme]) .card .text-muted,
:root:not([data-bs-theme]) .card .text-secondary {
    color: #6c757d !important; /* Ensure secondary text is visible */
}

[data-bs-theme="light"] .card:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); /* Add shadow for better contrast */
}

/* Light theme - link colors in titles */
[data-bs-theme="light"] .card-title a,
:root:not([data-bs-theme]) .card-title a {
    color: #212529;
}

[data-bs-theme="light"] .card-title a:hover,
:root:not([data-bs-theme]) .card-title a:hover {
    color: #0d6efd;
}

/* Dark theme - link colors in titles */
[data-bs-theme="dark"] .card-title a,
[data-bs-theme="dark"] .card-title a.text-dark {
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .card-title a:hover {
    color: #fff !important;
}

/* Dark theme - card backgrounds with Glassmorphism */
[data-bs-theme="dark"] .card {
    background: rgba(30, 39, 50, 0.6) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .card:hover {
    background: rgba(40, 49, 60, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 20px rgba(13, 110, 253, 0.1);
}

[data-bs-theme="dark"] .card-body {
    color: #e0e0e0;
}

/* Dark theme - headings */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: #f8f9fa;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Dark theme - icons with smooth transitions */
[data-bs-theme="dark"] .card-body i {
    opacity: 0.8;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.1));
}

[data-bs-theme="dark"] .card:hover .card-body i {
    opacity: 1;
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

[data-bs-theme="dark"] .text-primary {
    color: #6ea8fe !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #adb5bd !important;
}

/* Button animations */
.tools-grid .btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.tools-grid .btn:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.tools-grid .btn:hover:before {
    width: 300px;
    height: 300px;
}

.tools-grid .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Badge animations */
.tools-grid .badge {
    transition: all 0.2s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.tools-grid .card:hover .badge {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Card body fade-in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tools-grid .card {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* Stagger animation for multiple cards */
.tools-grid .card:nth-child(1) { animation-delay: 0.05s; }
.tools-grid .card:nth-child(2) { animation-delay: 0.1s; }
.tools-grid .card:nth-child(3) { animation-delay: 0.15s; }
.tools-grid .card:nth-child(4) { animation-delay: 0.2s; }
.tools-grid .card:nth-child(5) { animation-delay: 0.25s; }
.tools-grid .card:nth-child(6) { animation-delay: 0.3s; }
.tools-grid .card:nth-child(7) { animation-delay: 0.35s; }
.tools-grid .card:nth-child(8) { animation-delay: 0.4s; }

/* Smooth transitions for text */
.tools-grid .card-text,
.tools-grid .card-title {
    transition: color 0.2s ease;
}

/* Icon pulse animation on hover */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.tools-grid .card:hover i.bi-play-fill {
    animation: pulse 1.5s infinite;
}

/* Category section title styling */
.tools-category-title {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tools-category-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, var(--bs-primary) 0%, rgba(var(--bs-primary-rgb), 0.2) 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.mb-5:hover .tools-category-title:after {
    width: 100px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tools-grid .card:hover {
        transform: translateY(-5px);
    }
    
    .tools-blob {
        opacity: 0.3;
    }
}
