/* styles.css - All fixes applied */
:root {
    --color-bg: #ffffff;
    --color-text: #000000;
    --color-text-secondary: #666666;
    --color-accent: #3b82f6;
    --color-header-bg: rgba(0, 0, 0, 0.60);
    
    --radius-header: 58px;
    --radius-card: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    font-family: 'Archivo', sans-serif; 
    background: var(--color-bg); 
    color: var(--color-text);
    overflow-x: hidden;
}

/* Custom Cursor - No filters, original colors */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    transition: opacity 0.2s ease, transform 0.15s ease-out;
}

.custom-cursor.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

@media (pointer: coarse) {
    .custom-cursor { display: none; }
}

/* Background - Purple REMOVED, only blue */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.blue-blur-container {
    position: absolute;
    top: 200px;
    right: 400px;
    width: 1000px;
    height: 400px;
    animation: slowRotate 20s linear infinite;
}

.blue-blur { width: 100%; height: 100%; opacity: 0.9; }

@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Header - FIXED mobile scaling */
.main-header {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 1200px;
    z-index: 1000;
    border-radius: 30px;
    background: var(--color-header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    min-height: 60px;
}

.logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img { 
    height: 28px; 
    width: auto; 
    max-width: 120px;
   
}

.main-nav { 
    display: flex; 
    align-items: center; 
    gap: 32px; 
}

/* FIXED: No underline, blue color on hover */
.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover { 
    color: #3b82f6; 
    text-decoration: none;
}

/* FIXED: Submit button no underline */
.submit-btn {
    background: #3b82f6;
    color: white;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    text-decoration: none;
    flex-shrink: 0;
}

.submit-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(0,0,0,0.05);
    color: #000;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
}

.modal-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    font-family: 'Archivo', sans-serif;
    font-size: 15px;
    transition: border-color 0.2s;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-submit {
    background: #3b82f6;
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}

.modal-submit:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

/* Hero */
.hero-section { padding-top: 140px; padding-bottom: 60px; text-align: center; }

.hero-content { max-width: 900px; margin: 0 auto; padding: 0 24px; }

.hero-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    padding: 12px 20px;
    border-radius: 100px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.badge-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-secondary);
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.typewriter-word {
    color: #3b82f6;
    display: inline;
}

.typewriter-word::after {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
    color: #3b82f6;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-icons { display: inline-block; margin-left: 12px; vertical-align: middle; }
.hero-icons img { width: 140px; height: auto; }

.hero-subtitle {
    font-size: 18px;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Categories - FIXED equal width, no squeezing */
.categories-section { 
    padding: 40px 0; 
    scroll-margin-top: 140px; /* FIXED: Anchor offset so header doesn't cover */
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
}

/* All items same width - FIXED */
.category-item {
    display: flex;
    width: 186px; /* Fixed width for ALL */
    padding: 16px;
    align-items: center;
    gap: 10px;
    background: rgba(250, 250, 250, 0.92);
    border: 0px solid rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    /*box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);*/
}

.category-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}
/* First row: 5 items */
.categories-grid .category-item:nth-child(-n+5) {
    /* No special styling needed */
}

/* Second row: 6 items - natural flow */
.categories-grid .category-item:nth-child(n+6) {
    /* Slightly smaller or same, browser will fit 6 per row */
}
/* Shake animation on scroll */
.categories-grid.shake .category-item {
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px) rotate(-2deg); }
    20%, 40%, 60%, 80% { transform: translateX(5px) rotate(2deg); }
}

.category-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    .category-icon {
        width: 28px;
        height: 28px;
    }
}
.category-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    .category-name {
        font-size: 14px;
    }
}


/* Resources Sections */
.resources-section { padding: 60px 0; }

.section-header { margin-bottom: 32px; }

.section-title { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }

/* FIXED: 4 columns tight */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Card - EXACT UI match with swapped positions */
.resource-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--radius-card);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    /*box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);*/
}

.resource-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12); }

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.resource-card:hover .card-image { transform: scale(1.05); }

.tool-logo-text {
    font-size: 48px;
    font-weight: 700;
    color: #ccc;
    text-transform: uppercase;
}

/* BADGE POSITIONS - FIXED per reference UI */
/* Top Left: Subcategory */
.badge-subcategory {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Top Right: Early Access (was featured, now swapped) */
.badge-early {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    z-index: 2;
    /* No background - show original icon only */
}

.badge-early img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none; /* Show original */
}

/* Bottom Left: Featured/Verified (was early access, now swapped) */
/*.badge-featured {*/
/*    position: absolute;*/
/*    bottom: 12px;*/
/*    left: 12px;*/
/*    width: 32px;*/
/*    height: 32px;*/
/*    z-index: 2;*/
/*}*/

/*.badge-featured img {*/
/*    width: 100%;*/
/*    height: 100%;*/
/*    object-fit: contain;*/
/*}*/

/* Bottom Right: Premium (unchanged) */
.badge-premium {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    z-index: 2;
}

.badge-premium img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Tooltip on hover */
.tooltip {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

/*.badge-featured:hover .tooltip,*/
.badge-early:hover .tooltip,
.badge-premium:hover .tooltip {
    opacity: 1;
}

/* Card Content */
.card-content { padding: 16px; display: flex; flex-direction: column; gap: 8px; }

.card-header { display: flex; align-items: center; gap: 6px; }

.card-title { font-size: 17px; font-weight: 700; color: var(--color-text); margin: 0; }

.icon-verified {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.card-description {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-card:active { transform: scale(0.98); }

/* Footer */
.main-footer { background: #000; color: white; padding: 60px 24px 40px; margin-top: 100px; border-radius: 32px 32px 0 0; }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 32px; }
.footer-logo { width: 350px; }
.footer-logo-img { width: 100%; filter: brightness(0) invert(1); }
.social-links { display: flex; gap: 16px; }
.social-link { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.1); transition: all 0.3s ease; }
.social-link:hover { background: rgba(255,255,255,0.2); transform: translateY(-3px); }
.social-link img { width: 20px; height: 20px; filter: brightness(0) invert(1); }
.footer-nav { display: flex; gap: 32px; flex-wrap: wrap; justify-content: center; }
.footer-link { color: rgba(255,255,255,0.7); font-size: 14px; font-weight: 500; text-decoration: none; }
.footer-link:hover { color: white; }
.copyright { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 16px; }

/* Animations */
.fade-in { animation: fadeIn 0.5s ease forwards; opacity: 0; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Fixes */
@media (max-width: 900px) {
    .resources-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 36px; }
    
    /* Mobile Header: Logo and button only, no overlap */
    .main-header {
        top: 12px;
        width: calc(100% - 24px);
        border-radius: 20px;
    }
    
    .header-container {
        padding: 10px 16px;
        min-height: 56px;
    }
    
    .logo-img {
        height: 26px;
        max-width: 100px;
    }
    
    .main-nav { display: none; }
    
    .submit-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    /* Mobile Categories: 2 per row, last centered */
    .category-item {
        width: calc(50% - 8px); /* 2 per row */
    }
    
    .categories-grid {
        justify-content: center;
    }
    
    /* Center last item if odd number */
    .categories-grid::after {
        content: '';
        width: calc(50% - 8px);
    }
}

@media (max-width: 600px) {
    .resources-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 28px; }
    
    .modal-content {
        padding: 24px;
        margin: 10px;
    }
    
    .blue-blur-container {
        width: 300px;
        height: 300px;
        top: -50px;
        right: -50px;
    }
    
    /* Ensure last category centers on mobile */
    .categories-grid .category-item:last-child:nth-child(odd) {
        margin: 0 auto;
    }
}

/* ADD THIS to your styles.css - Category Page Specific Fixes */

/* Category Hero - FIXED spacing and z-index */
.category-hero {
    padding-top: 110px; /* Increased to prevent header overlap */
    padding-bottom: 30px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.category-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.category-icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.category-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-title {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
}

/* FIXED: Subcategory filters - visible and proper styling */
.subcategory-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 24px;
    margin-bottom: 40px;
    position: relative;
    z-index: 10; /* Above other elements */
}

.filter-chip {
    padding: 10px 24px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid transparent;
    border-radius: 100px;
    font-family: 'Archivo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.filter-chip:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--color-text);
}

.filter-chip.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* FIXED: Category resources section */
.category-resources-section {
    padding: 20px 0 80px 0;
    min-height: 400px;
}

/* FIXED: Loader - only show when needed */
.scroll-loader {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.scroll-loader.visible {
    display: flex;
}

.scroll-loader.hidden {
    display: none !important;
}

.loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile fixes for category page */
@media (max-width: 900px) {
    .category-hero {
        padding-top: 140px;
    }
    
    .category-title {
        font-size: 32px;
    }
    
    .subcategory-filters {
        gap: 8px;
        padding: 0 16px;
    }
    
    .filter-chip {
        padding: 8px 16px;
        font-size: 13px;
    }
}
/* Premium Badge with White Circle Background */
.badge-premium {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 32px; /* Slightly larger for circle */
    height: 32px;
    z-index: 2;
    background: white; /* White circle */
    border-radius: 50%; /* Perfect circle */
    padding: 4px; /* Space between icon and edge */
    /*box-shadow: 0 2px 8px rgba(0,0,0,0.15);*/
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-premium img {
    width: 20px; /* Slightly smaller to fit inside padding */
    height: 20px;
    object-fit: contain;
}

/* Hero Badge with Pulsing Dot */
.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    padding: 10px 20px;
    border-radius: 100px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.badge-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pulsing Blue Dot */
.pulse-dot {
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

/* Pulse animation rings */
.pulse-dot::before,
.pulse-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: #3b82f6;
    border-radius: 50%;
    animation: pulse-ring 2s ease-out infinite;
}

.pulse-dot::after {
    animation-delay: 1s;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

.badge-text {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
}