/* ==========================================================================
   CSS Variables & Tokens
   ========================================================================== */
:root {
    /* Colors */
    --bg-dark: #0f172a; /* Slate 900 */
    --bg-darker: #020617; /* Slate 950 */
    --bg-card: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity */
    --text-primary: #f8fafc; /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --primary-gradient-hover: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    /* Layout & Shadows */
    --max-width: 1200px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.5);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Base Utility Classes */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-center {
    text-align: center;
}

/* ==========================================================================
   Navbar & Search
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.search-bar-nav {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    padding: 0.4rem 1rem;
    margin-left: 1rem;
}

.search-bar-nav input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 150px;
    font-family: var(--font-sans);
}

.search-bar-nav input::placeholder {
    color: var(--text-secondary);
}

.search-bar-nav i {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    min-height: 80vh; /* Reduced from 100vh for tools list visibility */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
}

/* Background Glowing Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
}

.orb-1 {
    top: 20%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: #8b5cf6;
}

.orb-2 {
    bottom: 10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: #3b82f6;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   Split Hero Container (Homepage)
   ========================================================================== */
.split-hero-container {
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    z-index: 10;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .split-hero-container {
        flex-direction: column;
        margin-top: 2rem;
    }
}

.split-card {
    flex: 1;
    position: relative;
    border-radius: 24px;
    padding: 3rem 2rem;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 400px;
    justify-content: center;
}

.split-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255,255,255,0.2);
}

.tools-card:hover {
    box-shadow: 0 20px 40px -10px rgba(139, 92, 246, 0.4);
}

.apps-card:hover {
    box-shadow: 0 20px 40px -10px rgba(16, 185, 129, 0.4);
}

.split-card-bg {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.tools-card .split-card-bg {
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
}

.apps-card .split-card-bg {
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
}

.split-card:hover .split-card-bg {
    opacity: 1;
}

.split-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.split-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.4s ease;
}

.tools-card .split-icon-wrapper {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
    color: #a78bfa;
}

.apps-card .split-icon-wrapper {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    color: #34d399;
}

.split-card:hover .split-icon-wrapper {
    transform: scale(1.1) translateY(-5px);
}

.split-card h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tools-card:hover h2 {
    background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.apps-card:hover h2 {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.split-card p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 80%;
    line-height: 1.6;
}

.split-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-gradient);
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.split-card:hover .split-btn {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.3);
}

/* ==========================================================================
   AdSense Placeholders
   ========================================================================== */
.ad-container {
    width: 100%;
    max-width: 970px; /* Standard AdSense large leaderboard width */
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    border-radius: var(--radius-md);
}

.ad-placeholder-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ==========================================================================
   Tools / Apps Section
   ========================================================================== */
.apps-section {
    padding: 2rem 2rem 6rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-header {
    margin-bottom: 3rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* Category Filters */
.category-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* Tools Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.3);
}

.app-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.app-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.tag {
    background: rgba(255,255,255,0.05);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    background: var(--bg-darker);
    padding: 4rem 2rem 2rem;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    flex: 1;
    min-width: 300px;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 1rem;
    max-width: 400px;
}

.footer-links h3 {
    font-family: var(--font-heading);
    margin-bottom: 1rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
}

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

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    color: var(--text-secondary);
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
}

/* ==========================================================================
   Tool Workspace (PDF Editor)
   ========================================================================== */
.tool-workspace {
    display: flex;
    max-width: var(--max-width);
    margin: 2rem auto;
    gap: 2rem;
    padding: 0 2rem;
    min-height: 600px;
}

.tool-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: fit-content;
}

.tool-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-primary);
}

.tool-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.upload-btn {
    width: 100%;
    cursor: pointer;
    text-align: center;
}

.tool-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    outline: none;
}

.tool-input:focus {
    border-color: #3b82f6;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    border: 1px solid #3b82f6;
    color: #3b82f6;
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.1);
}

.page-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

.page-controls span {
    font-size: 0.9rem;
    font-weight: 500;
}

.page-controls button {
    padding: 0.5rem 1rem;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--glass-border);
    margin: 1rem 0;
}

.tool-viewer {
    flex-grow: 1;
    background: #e2e8f0; /* Light gray for document background */
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    min-height: 500px;
}

.viewer-container {
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.empty-state {
    text-align: center;
    color: #64748b;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: #94a3b8;
}

.text-layer {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.draggable-text {
    position: absolute;
    cursor: move;
    font-family: Helvetica, sans-serif;
    font-size: 16px;
    color: black;
    white-space: nowrap;
    user-select: none;
    border: 1px dashed rgba(59, 130, 246, 0.5);
    padding: 2px;
}

.draggable-text:hover {
    border: 1px solid #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .hero {
        padding-top: 8rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .nav-container {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }
    
    .logo {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.2rem;
    }

    .nav-links {
        display: flex;
        gap: 0.5rem;
        font-size: 0.85rem;
        width: 100%;
        justify-content: center;
    }
    
    .search-bar-nav {
        display: flex;
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
        justify-content: center;
    }
    
    .search-bar-nav input {
        width: 100%;
        text-align: center;
    }

    .nav-toggle {
        display: none; 
    }
    
    .tool-workspace {
        flex-direction: column;
    }
    
    .tool-sidebar {
        width: 100%;
    }
}

/* ==========================================================================
   Donate Button & Modal
   ========================================================================== */
.donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 3px 12px rgba(245,158,11,0.35);
    letter-spacing: 0.02em;
}
.donate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245,158,11,0.5);
}
.donate-btn i { font-size: 0.9rem; animation: heartbeat 1.4s ease infinite; }
@keyframes heartbeat {
    0%,100% { transform: scale(1); }
    14%      { transform: scale(1.3); }
    28%      { transform: scale(1); }
    42%      { transform: scale(1.2); }
    56%      { transform: scale(1); }
}

/* Overlay */
.donate-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,0.75);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.donate-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Modal Box */
.donate-modal {
    margin: auto;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 560px;
    position: relative;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}
.donate-overlay.active .donate-modal {
    transform: translateY(0) scale(1);
}
.donate-modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: rgba(255,255,255,0.08);
    border: none; color: #94a3b8;
    width: 30px; height: 30px;
    border-radius: 50%;
    font-size: 1.1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.donate-modal-close:hover { background: rgba(255,255,255,0.15); color: white; }
.donate-modal h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.35rem;
}
.donate-modal > p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Donate Cards Row */
.donate-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 500px) {
    .donate-cards { grid-template-columns: 1fr; }
}
.donate-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    text-align: center;
    transition: var(--transition);
}
.donate-card:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); }
.donate-card-icon {
    font-size: 2.2rem;
    line-height: 1;
}
.donate-card h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: white;
}
.donate-card p {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

/* PayPal card */
.paypal-card .donate-card-icon { color: #009cde; }
.paypal-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: #009cde;
    color: white;
    border: none;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-full);
    font-weight: 700; font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    width: 100%; justify-content: center;
}
.paypal-btn:hover { background: #0070ba; transform: translateY(-1px); }

/* Solana card */
.solana-card .donate-card-icon { color: #9945ff; }
.solana-logo-svg { width: 48px; height: auto; display: block; filter: drop-shadow(0 0 8px rgba(153,69,255,0.5)); }
.solana-qr img {
    width: 120px; height: 120px;
    border-radius: 8px;
    border: 3px solid rgba(153,69,255,0.3);
}
.solana-address {
    font-size: 0.65rem;
    color: #94a3b8;
    word-break: break-all;
    background: rgba(0,0,0,0.3);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-family: monospace;
    line-height: 1.4;
    width: 100%;
    text-align: center;
}
.solana-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: linear-gradient(135deg, #9945ff, #6d28d9);
    color: white;
    border: none;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-full);
    font-weight: 700; font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%; justify-content: center;
}
.solana-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(153,69,255,0.4); }
