/* ============================================
   FreeWebTools - Premium Design System
   ============================================ */

/* ============================================
   CSS RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ============================================
       COLOR SYSTEM
       ============================================ */
    /* Primary Colors */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    
    /* Accent Colors */
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-orange: #f97316;
    --accent-green: #10b981;
    --accent-yellow: #fbbf24;
    --accent-red: #ef4444;
    
    /* Neutral Colors */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-sunset: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-ocean: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-fire: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-forest: linear-gradient(135deg, #13f1fc 0%, #0470dc 100%);
    --gradient-cyber: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    
    /* Background Gradients */
    --bg-gradient-light: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --bg-gradient-dark: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    
    /* ============================================
       TYPOGRAPHY
       ============================================ */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    
    /* ============================================
       SPACING SYSTEM (4px base)
       ============================================ */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    
    /* ============================================
       SHADOWS & EFFECTS
       ============================================ */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Colored Shadows */
    --shadow-primary: 0 10px 40px -10px rgba(14, 165, 233, 0.3);
    --shadow-purple: 0 10px 40px -10px rgba(139, 92, 246, 0.3);
    --shadow-pink: 0 10px 40px -10px rgba(236, 72, 153, 0.3);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    /* ============================================
       BORDER RADIUS
       ============================================ */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;
    
    /* ============================================
       Z-INDEX SCALE
       ============================================ */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    
    /* ============================================
       TRANSITIONS
       ============================================ */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   BASE STYLES
   ============================================ */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--neutral-900);
    background: var(--bg-gradient-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--neutral-900);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-4);
}

/* ============================================
   NAVIGATION HEADER
   ============================================ */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-sm);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
    gap: var(--space-8);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-2xl);
    font-weight: var(--font-extrabold);
    color: var(--neutral-900);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--text-xl);
}

.nav-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-12);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-full);
    font-size: var(--text-base);
    transition: all var(--transition-fast);
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: var(--shadow-primary);
}

.search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-400);
    font-size: var(--text-lg);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    list-style: none;
}

.nav-link {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--neutral-700);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.nav-link.active {
    color: var(--primary-600);
    background: var(--primary-50);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: var(--text-2xl);
    cursor: pointer;
    color: var(--neutral-700);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    padding: var(--space-20) 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="white" stroke-width="1" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    color: white;
    font-size: var(--text-6xl);
    margin-bottom: var(--space-6);
    animation: fadeInUp 0.8s ease-out;
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--text-xl);
    margin-bottom: var(--space-8);
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.hero-search-input {
    width: 100%;
    padding: var(--space-5) var(--space-6);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--text-lg);
    box-shadow: var(--shadow-2xl);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-12);
    margin-top: var(--space-12);
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-size: var(--text-4xl);
    font-weight: var(--font-extrabold);
    color: white;
    display: block;
}

.hero-stat-label {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.8);
    display: block;
    margin-top: var(--space-2);
}

/* ============================================
   CATEGORY GRID
   ============================================ */
.categories-section {
    padding: var(--space-20) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.section-title {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: var(--text-xl);
    color: var(--neutral-600);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
}

.category-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    cursor: pointer;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--primary-200);
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-3xl);
    margin-bottom: var(--space-4);
    color: white;
}

.category-card[data-category="image"] .category-icon {
    background: var(--gradient-ocean);
}

.category-card[data-category="pdf"] .category-icon {
    background: var(--gradient-sunset);
}

.category-card[data-category="video"] .category-icon {
    background: var(--gradient-fire);
}

.category-card[data-category="text"] .category-icon {
    background: var(--gradient-forest);
}

.category-card[data-category="converter"] .category-icon {
    background: var(--gradient-cyber);
}

.category-title {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-3);
}

.category-description {
    color: var(--neutral-600);
    margin-bottom: var(--space-4);
}

.category-count {
    color: var(--primary-600);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
}

/* ============================================
   TOOL CARDS
   ============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}

.tool-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow);
    transition: all var(--transition-base);
    border: 1px solid var(--neutral-200);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    margin-bottom: var(--space-4);
    background: var(--primary-50);
    color: var(--primary-600);
}

.tool-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.tool-description {
    font-size: var(--text-sm);
    color: var(--neutral-600);
    line-height: var(--leading-relaxed);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: var(--neutral-100);
    color: var(--neutral-900);
}

.btn-secondary:hover {
    background: var(--neutral-200);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-600);
    color: var(--primary-600);
}

.btn-outline:hover {
    background: var(--primary-600);
    color: white;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

/* ============================================
   FILE UPLOAD ZONE
   ============================================ */
.upload-zone {
    border: 3px dashed var(--neutral-300);
    border-radius: var(--radius-2xl);
    padding: var(--space-16);
    text-align: center;
    background: var(--neutral-50);
    transition: all var(--transition-base);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.upload-icon {
    font-size: var(--text-6xl);
    color: var(--neutral-400);
    margin-bottom: var(--space-4);
}

.upload-text {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-2);
}

.upload-hint {
    font-size: var(--text-sm);
    color: var(--neutral-500);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--neutral-900);
    color: var(--neutral-300);
    padding: var(--space-16) 0 var(--space-8);
    margin-top: var(--space-20);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

.footer-section h3 {
    color: white;
    font-size: var(--text-lg);
    margin-bottom: var(--space-4);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-2);
}

.footer-links a {
    color: var(--neutral-400);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-400);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-8);
    border-top: 1px solid var(--neutral-800);
    color: var(--neutral-500);
}

/* ============================================
   AD CONTAINER
   ============================================ */
.ad-container {
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: center;
    margin: var(--space-8) 0;
}

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    background: white;
    border-radius: var(--radius-md);
    color: var(--neutral-400);
    font-size: var(--text-sm);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --text-6xl: 3rem;
        --text-5xl: 2.5rem;
        --text-4xl: 2rem;
    }
    
    .hero {
        padding: var(--space-16) 0;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-search {
        max-width: 100%;
    }
    
    .hero h1 {
        font-size: var(--text-4xl);
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-6);
    }
    
    .category-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    .hero {
        padding: var(--space-12) 0;
    }
    
    .categories-section {
        padding: var(--space-12) 0;
    }
}
