/**
 * Main Stylesheet for Anylistly
 * Based on modern, clean design principles
 * 
 * Structure:
 * 1. Reset & Base Styles
 * 2. Layout & Container
 * 3. Header & Navigation
 * 4. Hero Section
 * 5. Section Styles
 * 6. Card Components
 * 7. Tool Cards
 * 8. Buttons
 * 9. Footer
 * 10. Responsive Design
 */

/* ========================================
   1. RESET & BASE STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #fff;
    color: #333;
    line-height: 1.6;
}

/* ========================================
   2. LAYOUT & CONTAINER
======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   3. HEADER & NAVIGATION
======================================== */
header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-menu a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

/* Active Menu Item Underline Animation */
.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: #6366f1;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #6366f1;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Animated hamburger to X */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Search Icon */
.search-icon {
    font-size: 20px;
    cursor: pointer;
    color: #555;
    transition: color 0.3s ease;
}

.search-icon:hover {
    color: #6366f1;
}

/* ========================================
   4. HERO SECTION
======================================== */
.hero {
    text-align: center;
    padding: 100px 20px;
    background: linear-gradient(135deg, #f5f7ff 0%, #fff 100%);
}

.hero h1 {
    font-size: 48px;
    color: #1f2937;
    margin-bottom: 20px;
    font-weight: 700;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* Fade-in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Category Buttons in Hero */
.category-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.cat-btn {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease 0.4s both;
    text-decoration: none;
    color: inherit;
    display: block;
}

.cat-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

.cat-btn .icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.cat-btn h3 {
    font-size: 18px;
    color: #1f2937;
    font-weight: 600;
}

/* ========================================
   5. SECTION STYLES
======================================== */
section {
    padding: 80px 20px;
}

section h2 {
    font-size: 36px;
    text-align: center;
    margin-bottom: 50px;
    color: #1f2937;
    font-weight: 700;
    position: relative;
    display: inline-block;
    width: 100%;
}

/* Decorative underline for section headings */
section h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* ========================================
   6. CARD COMPONENTS
======================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.card {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
}

.card .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #1f2937;
    font-weight: 600;
}

.card p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

/* ========================================
   7. TOOL CARDS
======================================== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tool-card {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: #6366f1;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.tool-card .icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.tool-card h4 {
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
}

/* ========================================
   8. BUTTONS
======================================== */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-center {
    text-align: center;
}

/* ========================================
   9. TRUST SECTION
======================================== */
.trust {
    background: #f9fafb;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    text-align: center;
}

.trust-item .icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.trust-item h3 {
    font-size: 22px;
    margin-bottom: 12px;
    color: #1f2937;
    font-weight: 600;
}

.trust-item p {
    color: #6b7280;
}

/* ========================================
   10. FOOTER
======================================== */
footer {
    background: #1f2937;
    color: #fff;
    padding: 60px 20px 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col a {
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.footer-col a:hover {
    color: #fff;
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* ========================================
   11. UTILITY CLASSES
======================================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Background variations */
.bg-gray {
    background: #f9fafb;
}

.bg-white {
    background: #fff;
}

/* ========================================
   12. PAGE-SPECIFIC STYLES
======================================== */

/* Breadcrumb Navigation */

.breadcrumbs {
    padding: 20px 0;
    font-size: 14px;
    color: #6b7280;
}

.breadcrumbs a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #6366f1;
}

.breadcrumbs span {
    margin: 0 8px;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f5f7ff 0%, #fff 100%);
}

.page-header h1 {
    font-size: 42px;
    color: #1f2937;
    margin-bottom: 16px;
    font-weight: 700;
}

.page-header p {
    font-size: 18px;
    color: #6b7280;
    max-width: 700px;
    margin: 0 auto;
}

/* Detail Page Image */
.detail-image {
    text-align: center;
    padding: 40px 0;
}

.detail-image img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Tool Page Styles */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.tool-input-group {
    margin-bottom: 20px;
}

.tool-input-group label {
    display: block;
    margin-bottom: 8px;
    color: #1f2937;
    font-weight: 600;
}

.tool-input-group input,
.tool-input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.tool-input-group input:focus,
.tool-input-group select:focus {
    outline: none;
    border-color: #6366f1;
}

.tool-result {
    background: #f9fafb;
    padding: 30px;
    border-radius: 16px;
    margin-top: 30px;
    text-align: center;
}

.tool-result h3 {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 16px;
}

.tool-result .result-value {
    font-size: 48px;
    font-weight: 700;
    color: #6366f1;
    margin: 20px 0;
}


/* ========== VERSION 3: Text Style ========== */
.scroll-to-top-v3 {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 20px;
    background: #fff;
    color: #a855f7;
    border: 2px solid #a855f7;
    border-radius: 50px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
}

.scroll-to-top-v3:hover {
    background: #a855f7;
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.3);
}

.scroll-to-top-v3.show {
    display: flex;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* ========================================
   13. RESPONSIVE DESIGN
======================================== */
@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        gap: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 15px 10px;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-menu a::after {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .search-icon {
        display: none;
    }

    /* Hero */
    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }

    /* Sections */
    section {
        padding: 60px 20px;
    }

    section h2 {
        font-size: 28px;
    }

    .category-buttons {
        grid-template-columns: 1fr;
    }

    .logo img {
        height: 35px;
    }

    /* Page Header */
    .page-header h1 {
        font-size: 28px;
    }

    .page-header p {
        font-size: 16px;
    }

    /* Tool Result */
    .tool-result .result-value {
        font-size: 36px;
    }
    
     /* Scrool to TOP */
    .scroll-to-top-v3 {
        bottom: 20px;
        right: 20px;
        padding: 10px 16px;
        font-size: 12px;
    }
}