/* ===== Free Tools Page Styles ===== */
.ft-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    color: #1a1a2e;
    min-height: 100vh;
}

.ft-page *,
.ft-page *::before,
.ft-page *::after {
    box-sizing: border-box;
}

/* Hero / Header */
.ft-hero {
    text-align: center;
    margin-bottom: 32px;
    padding: 48px 24px;
    background: #ffffff;
    border: 1px solid #e8eaf0;
    border-radius: 20px;
    color: #1a1a2e;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.ft-hero h1,
h1.entry-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 12px;
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
    text-align: center;
}

.ft-hero p {
    font-size: 1.05rem;
    margin: 0;
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    color: #5a5a7a;
    opacity: 1;
}

/* Controls */
.ft-controls {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ft-search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.ft-search-input {
    width: 100%;
    padding: 14px 80px 14px 20px;
    border-radius: 12px;
    border: 1px solid #e8eaf0;
    background: #ffffff;
    font-size: 1rem;
    color: #1a1a2e;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    outline: none;
}

.ft-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.ft-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #5a5a7a;
    font-size: 18px;
    pointer-events: none;
}

.ft-search-clear {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #5a5a7a;
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.ft-search-clear:hover {
    background: #f0f2f5;
    color: #1a1a2e;
}

.ft-category-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ft-cat-btn {
    background: #ffffff;
    border: 1px solid #e8eaf0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #5a5a7a;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.ft-cat-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Category Section */
.ft-category {
    margin-bottom: 40px;
}

.ft-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8eaf0;
}

.ft-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ft-category-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a2e;
    letter-spacing: -0.3px;
}

/* Cards Grid */
.ft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}

/* Card */
.ft-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px 24px;
    border: 1px solid #e8eaf0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ft-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 14px 14px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ft-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.ft-card:hover::before {
    opacity: 1;
}

/* Category-specific accent colors */
.ft-card[data-cat="design"]::before {
    background: linear-gradient(90deg, #f093fb, #f5576c);
}

.ft-card[data-cat="education"]::before {
    background: linear-gradient(90deg, #4facfe, #00f2fe);
}

.ft-card[data-cat="library"]::before {
    background: linear-gradient(90deg, #43e97b, #38f9d7);
}

.ft-card[data-cat="utility"]::before {
    background: linear-gradient(90deg, #fa709a, #fee140);
}

.ft-card[data-cat="lifehack"]::before {
    background: linear-gradient(90deg, #a18cd1, #fbc2eb);
}

.ft-card[data-cat="productivity"]::before {
    background: linear-gradient(90deg, #f6d365, #fda085);
}

.ft-card[data-cat="privacy"]::before {
    background: linear-gradient(90deg, #84fab0, #8fd3f4);
}

.ft-card[data-cat="ai"]::before {
    background: linear-gradient(90deg, #b026ff, #1ec0ff);
}

.ft-card[data-cat="games"]::before {
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
}

.ft-card[data-cat="tldevtech"]::before {
    background: linear-gradient(90deg, #70e1f5, #ffd194);
}

.ft-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ft-card-title .ft-card-emoji {
    font-size: 22px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

/* Emoji background per category */
.ft-card[data-cat="design"] .ft-card-emoji {
    background: #fef0f7;
}

.ft-card[data-cat="education"] .ft-card-emoji {
    background: #eef6ff;
}

.ft-card[data-cat="library"] .ft-card-emoji {
    background: #edfcf5;
}

.ft-card[data-cat="utility"] .ft-card-emoji {
    background: #fff8ec;
}

.ft-card[data-cat="lifehack"] .ft-card-emoji {
    background: #f5f0ff;
}

.ft-card[data-cat="productivity"] .ft-card-emoji {
    background: #fff6f0;
}

.ft-card[data-cat="privacy"] .ft-card-emoji {
    background: #eafbf1;
}

.ft-card[data-cat="ai"] .ft-card-emoji {
    background: #f4ecff;
}

.ft-card[data-cat="games"] .ft-card-emoji {
    background: #ffecec;
}

.ft-card[data-cat="tldevtech"] .ft-card-emoji {
    background: #f0f7ff;
}

.ft-card-title a {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.3;
}

.ft-card-title a:hover {
    color: #667eea;
}

.ft-card-title a::after {
    content: ' ↗';
    font-size: 0.8em;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.ft-card-title a:hover::after {
    opacity: 1;
}

.ft-card-desc {
    font-size: 0.9rem;
    color: #5a5a7a;
    line-height: 1.6;
    margin: 0;
    padding-left: 46px;
}

/* Category icon background colors */
.ft-cat-design {
    background: linear-gradient(135deg, #ffeef8, #ffe0f0);
    color: #e84393;
}

.ft-cat-education {
    background: linear-gradient(135deg, #e8f4fd, #d0ebff);
    color: #0984e3;
}

.ft-cat-library {
    background: linear-gradient(135deg, #e6fcf0, #d0f5e0);
    color: #00b894;
}

.ft-cat-utility {
    background: linear-gradient(135deg, #fff5e0, #ffe8b8);
    color: #e17055;
}

.ft-cat-lifehack {
    background: linear-gradient(135deg, #f0e6ff, #e4d4f7);
    color: #6c5ce7;
}

.ft-cat-productivity {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #f39c12;
}

.ft-cat-privacy {
    background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
    color: #00897b;
}

.ft-cat-ai {
    background: linear-gradient(135deg, #f5e6ff, #e3c4ff);
    color: #9b59b6;
}

.ft-cat-games {
    background: linear-gradient(135deg, #ffeaeb, #ffcfd2);
    color: #e74c3c;
}

.ft-cat-tldevtech {
    background: linear-gradient(135deg, #e6f7ff, #bae7ff);
    color: #0050b3;
}

/* Responsive */
@media (max-width: 768px) {
    .ft-page {
        padding: 20px 14px 40px;
    }

    .ft-hero {
        padding: 32px 18px;
        border-radius: 16px;
        margin-bottom: 32px;
    }

    .ft-hero h1 {
        font-size: 1.6rem;
    }

    .ft-hero p {
        font-size: 0.95rem;
    }

    .ft-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ft-card {
        padding: 18px 18px;
    }

    .ft-card-desc {
        padding-left: 0;
    }
}

/* Subtle entrance animation */
@keyframes ft-fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ft-card {
    animation: ft-fadeUp 0.5s ease forwards;
    opacity: 0;
}

.ft-card:nth-child(1) {
    animation-delay: 0.05s;
}

.ft-card:nth-child(2) {
    animation-delay: 0.1s;
}

.ft-card:nth-child(3) {
    animation-delay: 0.15s;
}

.ft-card:nth-child(4) {
    animation-delay: 0.2s;
}

.ft-card:nth-child(5) {
    animation-delay: 0.25s;
}