/* ============================================
   Web Tools - Main Stylesheet
   Design sourced from UI/home.html & UI/tools.html
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300..700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background) !important;
    color: var(--text-primary) !important;
    line-height: 1.6 !important;
    -webkit-font-smoothing: antialiased !important;

}

.tool-container {
    max-width: 1100px !important;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}


:root {
    /* ── New Theme ─────────────────────────── */
    --primary: #6366F1;
    --primary-dark: #4F52E0;
    --secondary: #8B5CF6;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;

    /* ── Design system (updated to new palette) ─ */
    --white: #FFFFFF;
    --off-white: #F8FAFC;
    --soft-blue: #6366F1;
    --soft-purple: #8B5CF6;
    --soft-orange: #F97316;
    --soft-pink: #FDA4AF;
    --gray-600: #475569;
    --gray-800: #1E293B;
    --grad-primary: linear-gradient(135deg, #6366F1, #8B5CF6);
    --grad-accent: linear-gradient(145deg, #EEF2FF, #F5F3FF);
    --shadow-card: var(--shadow-md);
    --shadow-hover: var(--shadow-xl);
    --border-radius-xl: 1.5rem;
    --border-radius-lg: 1rem;
    --border-radius-md: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --primary-glow: rgba(99, 102, 241, 0.15);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* =====================
   HEADER / NAVBAR
   (Detailed styles are scoped inside components/header.html)
   ===================== */
header {
    position: sticky;
    top: 0;
    z-index: 999;
}

header {
    position: sticky !important;
    top: 0;
    z-index: 999 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-bottom: 1px solid var(--border, #E2E8F0) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
    transition: box-shadow 0.2s !important;
}

.header-in {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border, #E2E8F0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

/* Fallback for pages that don't use the component */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 1rem;
    padding: 0 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.logo {
    font-size: 1.55rem;
    font-weight: 800;
    background: linear-gradient(130deg, #6366F1, #8B5CF6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.03em;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}

/* =====================
   HERO — Home Page
   ===================== */
.hero {
    padding: 5rem 0 7rem;
    background: radial-gradient(ellipse at 20% 40%, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.06) 60%, var(--background) 90%);
    position: relative;
    isolation: isolate;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAwIiBoZWlnaHQ9IjYwMCIgdmlld0JveD0iMCAwIDYwMCA2MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHJhZGlhbEdyYWRpZW50IGlkPSJhIj48c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLW9wYWNpdHk9Ii4wNCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1vcGFjaXR5PSIwIi8+PC9yYWRpYWxHcmFkaWVudD48L2RlZnM+PHBhdGggZD0iTTAgMGg2MDB2NjAwSDB6IiBmaWxsPSJ1cmwoI2EpIi8+PC9zdmc+');
    opacity: 0.3;
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
}

.hero-left h1 {
    font-size: 3.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: black;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
    /* optional: remove default spacing for consistency */
}

.hero-left .highlight {
    background: linear-gradient(145deg, #6366F1, #8B5CF6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-left p {
    font-size: 1.3rem;
    margin: 1.8rem 0 2.5rem;
    color: var(--gray-600);
    max-width: 90%;
}

.btn-primary {
    display: inline-block;
    background: var(--grad-primary);
    color: white;
    font-weight: 600;
    padding: 1rem 2.5rem;
    border-radius: 60px;
    border: none;
    font-size: 1.1rem;
    font-family: inherit;
    box-shadow: 0 20px 30px -12px rgba(79, 108, 247, 0.5);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary:hover {
    transform: scale(1.03) translateY(-3px);
    box-shadow: 0 25px 35px -10px rgba(107, 76, 247, 0.6);
    color: white;
}

.hero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-label {
    color: #5f6b7f;
    font-size: 0.95rem;
}

.hero-right {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    border-radius: var(--border-radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.tool-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    border-radius: 100px;
    padding: 0.8rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.tool-badge:hover {
    transform: translateX(6px);
    box-shadow: 0 10px 20px rgba(79, 108, 247, 0.1);
}

/* =====================
   SECTION HEADINGS
   ===================== */
.section-heading {
    text-align: center;
    margin: 4rem 0 2rem;
}

.section-heading h2 {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(145deg, #262f4f, #4f2d7f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-heading p {
    font-size: 1.2rem;
    color: #4f5a74;
    max-width: 600px;
    margin: 0.8rem auto 0;
}

/* =====================
   TOOL CARDS
   ===================== */




.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem;
    margin: 2rem 0;
}

.all-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem;
    margin: 2rem 0 5rem;
}

.tool-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-xl);
    padding: 1.8rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--grad-primary);
    opacity: 0;
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
    border-color: var(--primary-glow);
}

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

.tool-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.tool-icon {
    background: var(--grad-accent);
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--primary);
    flex-shrink: 0;
    transition: var(--transition);
}

/* Icons8 img inside the normal tool icon box */
.tool-icon-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon-img,
.tool-card:hover .conv-img {
    transform: scale(1.1);
}

/* =====================
   CONVERTER CARD VISUAL
   ===================== */

/* .tool-card--converter matches normal card background — no separate style needed */

.converter-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 1.1rem 0.8rem;
    background: rgba(248, 250, 252, 0.7);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
    transition: background 0.3s ease;
}

.tool-card:hover .converter-visual {
    background: rgba(238, 242, 255, 0.8);
    border-color: rgba(99,102,241,0.25);
}

.conv-format {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.conv-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.tool-card:hover .conv-img {
    transform: scale(1.08);
}

.conv-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--primary);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
}

.conv-arrow-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--grad-primary);
    box-shadow: 0 4px 10px rgba(99,102,241,0.3);
}

.conv-arrow {
    color: #fff;
    font-size: 0.8rem;
    animation: slideRight 2s ease-in-out infinite;
}

@keyframes slideRight {
    0%, 100% { transform: translateX(-2px); opacity: 0.7; }
    50%       { transform: translateX(2px);  opacity: 1; }
}

.converter-header {
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.converter-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.2);
    padding: 0.25rem 0.65rem;
    border-radius: 40px;
}

.converter-badge i {
    font-size: 0.65rem;
}

.tool-category-badge {
    background: #f0f3fa;
    padding: 0.3rem 0.8rem;
    border-radius: 40px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tool-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.6rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.tool-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.5;
}

.tool-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.tool-link {
    text-decoration: none;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5ff;
    padding: 0.45rem 1rem;
    border-radius: 40px;
    transition: var(--transition);
    font-size: 0.85rem;
}

.tool-link:hover {
    background: var(--primary);
    color: white;
}

.tool-stats {
    display: flex;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* =====================
   CATEGORY GROUP HEADER
   ===================== */
.category-group-header {
    grid-column: 1 / -1;
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
}

.category-group-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gray-800);
    border-left: 4px solid var(--soft-blue);
    padding-left: 1rem;
    background: linear-gradient(135deg, #262f4f, #6228d7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* =====================
   PAGE HEADER (Tools Page)
   ===================== */
.page-header {
    padding: 4rem 0 2rem;
    text-align: center;
    background: radial-gradient(ellipse at 50% 30%, rgba(79, 108, 247, 0.08), transparent 70%);
}

.page-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(145deg, #262f4f, #4f2d7f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
    color: #4f5a74;
    max-width: 600px;
    margin: 0 auto;
}

/* =====================
   FILTER BAR
   ===================== */
/* Search bar – full width row */
.search-bar-wrapper {
    margin: 2rem 0 1.2rem;
    background: white;
    padding: 0.9rem 1.8rem;
    border-radius: 80px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(230, 235, 255, 0.8);
    transition: box-shadow 0.2s;
}

.search-bar-wrapper:focus-within {
    box-shadow: var(--shadow-hover);
    border-color: rgba(79, 108, 247, 0.3);
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #f4f7fd;
    padding: 0.7rem 1.5rem;
    border-radius: 60px;
}

.search-wrapper i {
    color: #8b5cf6;
    font-size: 1rem;
}

.search-wrapper input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    color: #1a1f2e;
}

/* Filter bar – separate row below search */
.filter-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 2.5rem;
    flex-wrap: wrap;
}

.filter-bar-label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Legacy .tools-filter kept for compatibility */
.tools-filter {
    display: none;
}

.category-filters {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: #f0f3fa;
    border: none;
    padding: 0.5rem 1.3rem;
    border-radius: 40px;
    font-weight: 500;
    color: #4a5168;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--grad-primary);
    color: white;
}

/* =====================
   WHY US / FEATURES
   ===================== */
.why-us {
    background: var(--off-white);
    border-radius: 60px;
    padding: 4rem 2rem;
    margin: 5rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2.5rem;
}

.feature-block {
    background: white;
    border-radius: 28px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.feature-block:hover {
    transform: translateY(-6px);
}

.feature-block i {
    font-size: 2.4rem;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    display: block;
}

.feature-block h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.feature-block p {
    color: #4a5168;
    font-size: 0.95rem;
}

/* =====================
   TESTIMONIALS
   ===================== */
.testimonial {
    background: transparent;
    padding: 3.5rem 0;
    margin: 3rem 0;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.testimonial-card {
    background: white;
    border-radius: 32px;
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.stars {
    color: #fbbf24;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* =====================
   FOOTER — legacy cleanup
   (All footer styles are now scoped inside components/footer.html)
   ===================== */
footer {
    background: var(--surface, #fff);
    border-top: 1px solid var(--border, #E2E8F0);
    margin-top: 0;
}

/* Fallback compatibility classes */
.footer-links {
    list-style: none;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--primary);
}

.copyright {
    text-align: center;
    padding: 1.2rem 2rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* =====================
   RESPONSIVE — Full Coverage
   ===================== */

/* Large tablets */
@media (max-width: 1100px) {
    .hero-left h1 {
        font-size: 3.2rem;
    }

    .section-heading h2 {
        font-size: 2.2rem;
    }

    .tools-grid,
    .all-tools-grid {
        gap: 1.4rem;
    }

    .about-grid,
    .contact-grid {
        gap: 2.5rem;
    }
}

/* Tablets */
@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 4rem 0 5rem;
    }

    .hero-right {
        margin-top: 1rem;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-section {
        padding: 3rem 1.5rem;
        border-radius: 2rem;
    }

    .about-stats {
        gap: 1.5rem;
    }

    .why-us {
        padding: 3rem 1.5rem;
        border-radius: 2rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .testimonial-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Large phones */
@media (max-width: 768px) {
    .hero-left h1 {
        font-size: 2.4rem;
    }

    .hero-left p {
        font-size: 1.05rem;
    }

    .hero-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .section-heading h2 {
        font-size: 2rem;
    }

    .section-heading p {
        font-size: 1rem;
    }

    .page-header h1 {
        font-size: 2.2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .tools-grid,
    .all-tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .testimonial-grid {
        grid-template-columns: 1fr;
    }

    .why-us {
        border-radius: 1.5rem;
    }

    .about-section {
        border-radius: 1.5rem;
    }

    .search-bar-wrapper {
        border-radius: 2rem;
    }

    .filter-bar-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .hero-right {
        padding: 1.5rem;
        border-radius: 1.5rem;
    }

    .tool-badge {
        padding: 0.6rem 1.2rem;
        gap: 0.75rem;
    }
}

/* Small phones */
@media (max-width: 500px) {
    .hero {
        padding: 2.5rem 0 3.5rem;
    }

    .hero-left h1 {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .btn-primary {
        width: 100%;
        text-align: center;
    }

    .section-heading h2 {
        font-size: 1.7rem;
    }

    .about-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .about-visual {
        padding: 1.5rem;
    }

    .testimonial {
        padding: 2rem 0;
    }

    .testimonial-card {
        padding: 1.5rem;
        border-radius: 1.2rem;
    }

    .tool-card {
        padding: 1.5rem;
    }
}