#tab-tools {
    padding: 0 24px 80px;
}

.tools-wrap {
    width: 100%;
    max-width: 1000px;
    margin-top: 80px;
}

.tools-hero {
    text-align: center;
    margin-bottom: 40px;
}

.tools-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 14px;
    padding: 6px 14px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 100px;
}

.tools-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: white;
    margin: 0 0 10px;
}

.tools-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.tools-warning {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.tools-warning-icon {
    width: 40px;
    height: 40px;
    background: rgba(220, 38, 38, 0.2);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fca5a5;
    flex-shrink: 0;
}

.tools-warning-title {
    color: #fca5a5;
    font-weight: 700;
    font-size: 0.95rem;
}

.tools-warning-text {
    color: #fecaca;
    font-size: 0.8rem;
    opacity: 0.9;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin-bottom: 40px;
    overflow: visible;
}

.tools-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: toolsCardIn 0.6s var(--ease-warp) backwards;
}

.tools-card * {
    pointer-events: none;
}

.tools-card:nth-child(1) { animation-delay: 0.05s; }
.tools-card:nth-child(2) { animation-delay: 0.08s; }
.tools-card:nth-child(3) { animation-delay: 0.11s; }
.tools-card:nth-child(4) { animation-delay: 0.14s; }
.tools-card:nth-child(5) { animation-delay: 0.17s; }
.tools-card:nth-child(6) { animation-delay: 0.2s; }
.tools-card:nth-child(7) { animation-delay: 0.23s; }
.tools-card:nth-child(8) { animation-delay: 0.26s; }
.tools-card:nth-child(9) { animation-delay: 0.29s; }
.tools-card:nth-child(10) { animation-delay: 0.32s; }
.tools-card:nth-child(11) { animation-delay: 0.35s; }
.tools-card:nth-child(12) { animation-delay: 0.38s; }
.tools-card:nth-child(13) { animation-delay: 0.41s; }
.tools-card:nth-child(14) { animation-delay: 0.44s; }
.tools-card:nth-child(15) { animation-delay: 0.47s; }
.tools-card:nth-child(16) { animation-delay: 0.5s; }
.tools-card:nth-child(17) { animation-delay: 0.53s; }
.tools-card:nth-child(18) { animation-delay: 0.56s; }

@keyframes toolsCardIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom property for conic gradient angle - enables smooth perimeter flow */
@property --border-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

/* Animated border - colors flow around the full perimeter (top→right→bottom→left) */
.tools-card::before {
    content: '';
    position: absolute;
    inset: -4px;
    z-index: -1;
    border-radius: 24px;
    padding: 4px;
    /* Conic gradient = flow around all 4 sides; start = end for invisible loop */
    background: conic-gradient(
        from var(--border-angle) at 50% 50%,
        #1e3a8a 0deg,
        #1e40af 45deg,
        #2563eb 90deg,
        #3b82f6 135deg,
        #60a5fa 180deg,
        #93c5fd 225deg,
        #bfdbfe 270deg,
        #eff6ff 315deg,
        #1e3a8a 360deg
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.tools-card.active::before {
    opacity: 1;
    animation: toolsBorderFlow 5s linear infinite;
}

/* Rotate gradient 360deg = one full lap around the border, perfectly seamless */
@keyframes toolsBorderFlow {
    to { --border-angle: 360deg; }
}

/* Pulsing outer glow when selected */
.tools-card::after {
    content: '';
    position: absolute;
    inset: -8px;
    z-index: -2;
    border-radius: 28px;
    background: radial-gradient(
        ellipse at center,
        rgba(59, 130, 246, 0.25) 0%,
        rgba(59, 130, 246, 0.08) 40%,
        transparent 70%
    );
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.tools-card.active::after {
    opacity: 1;
    animation: toolsGlowPulse 2.5s ease-in-out infinite;
}

@keyframes toolsGlowPulse {
    0%, 100% { opacity: 0.5; filter: blur(12px); }
    50% { opacity: 1; filter: blur(16px); }
}

.tools-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.1);
}

.tools-card.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.15), inset 0 0 20px rgba(59, 130, 246, 0.03);
}

.tools-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.tools-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tools-card.active .tools-card-icon {
    transform: scale(1.08);
}

.tools-toggle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tools-card.active .tools-toggle {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.5);
}

.tools-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin: 0 0 6px;
}

.tools-card p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.tools-generate-section {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.tools-generate-btn {
    width: 100%;
    max-width: 500px;
    height: 58px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #0ea5e9 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 30px -5px rgba(59, 130, 246, 0.4);
}

.tools-generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px -5px rgba(59, 130, 246, 0.5);
    background-position: 100% 50%;
}

.tools-generate-btn:active {
    transform: translateY(-1px);
}

.tools-generate-btn i {
    transition: transform 0.3s ease;
}

.tools-generate-btn:hover i {
    transform: translateY(2px);
}

.tools-generate-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
