:root {
            --primary-color: #6366f1;
            --primary-dark: #4f46e5;
            --primary-light: #a5b4fc;
            --secondary-color: #f1f5f9;
            --accent-color: #10b981;
            --accent-dark: #059669;
            --danger-color: #ef4444;
            --warning-color: #f59e0b;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --text-muted: #94a3b8;
            --border-color: #e2e8f0;
            --border-light: #f1f5f9;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
            --radius-sm: 0.375rem;
            --radius-md: 0.5rem;
            --radius-lg: 0.75rem;
            --radius-xl: 1rem;
            --radius-2xl: 1.5rem;
            --touch-target-min: 44px;
            --container-padding: 2rem;
            
            /* Background colors for light and dark themes */
            --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --bg-secondary: rgba(255, 255, 255, 0.95);
            --header-bg: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
            --footer-bg: rgba(15, 23, 42, 0.95);
        }

        /* Dark theme variables */
        [data-theme="dark"] {
            --text-primary: #f1f5f9;
            --text-secondary: #cbd5e1;
            --text-muted: #94a3b8;
            --border-color: #334155;
            --border-light: #1e293b;
            --bg-primary: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            --bg-secondary: rgba(15, 23, 42, 0.95);
            --header-bg: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            --footer-bg: rgba(255, 255, 255, 0.1);
        }

        * {
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            margin: 0;
            padding: 0;
            background: var(--bg-primary);
            min-height: 100vh;
            color: var(--text-primary);
            line-height: 1.6;
            transition: all 0.3s ease;
        }

        header {
            background: var(--header-bg);
            color: white;
            padding: clamp(2rem, 5vw, 4rem) var(--container-padding) clamp(1.5rem, 4vw, 3rem);
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
            opacity: 0.3;
        }

        /* Theme Toggle Button */
        .theme-toggle {
            position: absolute;
            top: 2rem;
            right: 2rem;
            background: rgba(255, 255, 255, 0.2);
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50px;
            padding: 0.75rem 1.5rem;
            color: white;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            z-index: 10;
            min-height: var(--touch-target-min);
            min-width: var(--touch-target-min);
        }

        .theme-toggle:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        }

        .theme-toggle:focus {
            outline: 2px solid rgba(255, 255, 255, 0.8);
            outline-offset: 2px;
        }

        .theme-toggle i {
            font-size: 1.2rem;
            transition: transform 0.3s ease;
        }

        .theme-toggle:hover i {
            transform: rotate(180deg);
        }

        /* Responsive theme toggle */
        @media (max-width: 768px) {
            .theme-toggle {
                top: 1rem;
                right: 1rem;
                padding: 0.5rem 1rem;
                font-size: 0.9rem;
            }
            
            .theme-toggle span {
                display: none;
            }
        }

        header h1 {
            font-family: 'Poppins', sans-serif;
            font-size: clamp(2rem, 6vw, 4rem);
            font-weight: 700;
            margin: 0 0 1rem;
            position: relative;
            z-index: 1;
            background: linear-gradient(45deg, #ffffff, #e0e7ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        header p {
            font-size: clamp(0.9rem, 2.5vw, 1.25rem);
            opacity: 0.9;
            margin: 0;
            position: relative;
            z-index: 1;
            font-weight: 300;
            max-width: 900px;
            margin: 0 auto;
            line-height: 1.7;
        }

        .hero-icon {
            font-size: clamp(2rem, 4vw, 3rem);
            margin-bottom: 1rem;
            opacity: 0.8;
            position: relative;
            z-index: 1;
        }

        .container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
            gap: clamp(1rem, 3vw, 2rem);
            padding: clamp(1.5rem, 4vw, 3rem) var(--container-padding);
            max-width: 1400px;
            margin: 0 auto;
            width: 100%;
        }

        .box {
            background: var(--bg-secondary);
            backdrop-filter: blur(10px);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-2xl);
            box-shadow: var(--shadow-lg);
            padding: clamp(1.25rem, 3vw, 2rem);
            text-align: center;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            min-height: clamp(140px, 20vw, 200px);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .box::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
            transition: left 0.5s;
        }

        [data-theme="dark"] .box::before {
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
        }

        .box:hover {
            transform: translateY(-8px) scale(1.02);
            box-shadow: var(--shadow-xl);
            border-color: var(--primary-light);
        }

        .box:hover::before {
            left: 100%;
        }

        .box:focus-within {
            outline: 2px solid var(--primary-color);
            outline-offset: 4px;
        }

        .box-icon {
            font-size: clamp(2rem, 4vw, 3rem);
            margin-bottom: clamp(0.75rem, 2vw, 1.5rem);
            background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            transition: all 0.3s ease;
        }

        .box:hover .box-icon {
            transform: scale(1.1);
        }

        .box h3 {
            margin: 0 0 clamp(0.5rem, 1.5vw, 0.75rem);
            font-family: 'Poppins', sans-serif;
            font-size: clamp(1.1rem, 2.5vw, 1.5rem);
            font-weight: 600;
            color: var(--text-primary);
            transition: color 0.3s ease;
        }

        .box:hover h3 {
            color: var(--primary-color);
        }

        .box p {
            margin: 0;
            color: var(--text-secondary);
            font-size: clamp(0.85rem, 2vw, 1rem);
            font-weight: 400;
            line-height: 1.5;
            max-width: 250px;
        }

        .box a {
            text-decoration: none;
            color: inherit;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            width: 100%;
            position: relative;
            z-index: 1;
            min-height: var(--touch-target-min);
            padding: 0.5rem;
        }

        .box a:focus {
            outline: none;
        }

        /* Tool Categories with Different Colors */
        .box.pdf-tool .box-icon {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .box.image-tool .box-icon {
            background: linear-gradient(135deg, #10b981, #059669);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .box.converter-tool .box-icon {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .box.utility-tool .box-icon {
            background: linear-gradient(135deg, #8b5cf6, #7c3aed);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        footer {
            background: var(--footer-bg);
            backdrop-filter: blur(10px);
            color: white;
            padding: clamp(1.5rem, 3vw, 2rem) var(--container-padding);
            text-align: center;
            margin-top: 2rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        [data-theme="dark"] footer {
            color: var(--text-primary);
            border-top-color: var(--border-color);
        }

        footer p {
            margin: 0;
            font-size: clamp(0.8rem, 2vw, 0.95rem);
            opacity: 0.8;
            line-height: 1.6;
        }

        /* Enhanced Responsive Design */
        
        /* Extra Large Desktop (1600px+) */
        @media (min-width: 1600px) {
            :root {
                --container-padding: 3rem;
            }
            
            .container {
                grid-template-columns: repeat(4, 1fr);
                gap: 2.5rem;
                max-width: 1600px;
            }
        }

        /* Large Desktop (1200px - 1599px) */
        @media (min-width: 1200px) and (max-width: 1599px) {
            :root {
                --container-padding: 2.5rem;
            }
            
            .container {
                grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
                gap: 2rem;
            }
        }

        /* Desktop (992px - 1199px) */
        @media (min-width: 992px) and (max-width: 1199px) {
            :root {
                --container-padding: 2rem;
            }
            
            .container {
                grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
                gap: 1.75rem;
            }
        }

        /* Tablet Large (768px - 991px) */
        @media (min-width: 768px) and (max-width: 991px) {
            :root {
                --container-padding: 1.5rem;
            }
            
            .container {
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                gap: 1.5rem;
            }
            
            .box {
                min-height: 180px;
                border-radius: var(--radius-xl);
            }
        }

        /* Tablet Small (576px - 767px) */
        @media (min-width: 576px) and (max-width: 767px) {
            :root {
                --container-padding: 1.25rem;
            }
            
            .container {
                grid-template-columns: repeat(2, 1fr);
                gap: 1.25rem;
            }
            
            .box {
                min-height: 160px;
                padding: 1.5rem 1rem;
            }
        }

        /* Mobile Large (480px - 575px) */
        @media (min-width: 480px) and (max-width: 575px) {
            :root {
                --container-padding: 1rem;
            }
            
            .container {
                grid-template-columns: repeat(2, 1fr);
                gap: 1rem;
            }
            
            .box {
                min-height: 140px;
                padding: 1.25rem 0.75rem;
                border-radius: var(--radius-lg);
            }
        }

        /* Mobile Small (320px - 479px) */
        @media (max-width: 479px) {
            :root {
                --container-padding: 0.75rem;
            }
            
            .container {
                grid-template-columns: 1fr;
                gap: 1rem;
                padding: 1.5rem 1rem;
            }
            
            .box {
                min-height: 120px;
                padding: 1.25rem;
                border-radius: var(--radius-lg);
            }
            
            .box p {
                max-width: none;
            }
        }

        /* Extra Small Mobile (up to 319px) */
        @media (max-width: 319px) {
            .container {
                padding: 1rem 0.5rem;
                gap: 0.75rem;
            }
            
            .box {
                min-height: 100px;
                padding: 1rem 0.75rem;
                border-radius: var(--radius-md);
            }
        }

        /* Touch device optimizations */
        @media (hover: none) and (pointer: coarse) {
            .box:hover {
                transform: none;
                box-shadow: var(--shadow-lg);
            }
            
            .box:hover .box-icon {
                transform: none;
            }
            
            .box {
                min-height: max(var(--touch-target-min), 120px);
                padding: 1.5rem;
            }
            
            .box a {
                min-height: var(--touch-target-min);
                padding: 1rem;
            }
        }

        /* Landscape orientation on mobile */
        @media (max-width: 767px) and (orientation: landscape) {
            .container {
                grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
                gap: 1rem;
                padding: 1rem;
            }
            
            .box {
                min-height: 100px;
                padding: 1rem;
            }
            
            header {
                padding: 1.5rem var(--container-padding) 1rem;
            }
        }

        /* High DPI displays */
        @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
            .box-icon, .hero-icon {
                -webkit-font-smoothing: antialiased;
                -moz-osx-font-smoothing: grayscale;
            }
        }

        /* High contrast mode */
        @media (prefers-contrast: high) {
            .box {
                border: 2px solid var(--text-primary);
                background: white;
            }
            
            .box h3 {
                color: var(--text-primary);
            }
            
            .box-icon {
                color: var(--text-primary) !important;
                -webkit-text-fill-color: var(--text-primary) !important;
            }
        }

        /* Reduced motion preferences */
        @media (prefers-reduced-motion: reduce) {
            * {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
            
            .box::before {
                display: none;
            }
            
            .box:hover {
                transform: none;
            }
            
            .theme-toggle:hover i {
                transform: none;
            }
        }

        /* Container queries for modern browsers */
        @supports (container-type: inline-size) {
            .container {
                container-type: inline-size;
            }
            
            @container (max-width: 600px) {
                .box {
                    min-height: 120px;
                    padding: 1rem;
                }
            }
        }

        /* Loading Animation */
        @keyframes pulse {
            0%, 100% {
                opacity: 1;
            }
            50% {
                opacity: 0.5;
            }
        }

        .loading {
            animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
        }

        /* Focus management for better accessibility */
        .box:focus-within a {
            outline: none;
        }

        /* Improved keyboard navigation */
        .box a:focus-visible {
            outline: 2px solid var(--primary-color);
            outline-offset: 2px;
            border-radius: var(--radius-md);
        }