/* ==========================================================================
   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);
}

/* ==========================================================================
   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-links, .search-bar-nav {
        display: none; 
    }
    
    .nav-toggle {
        display: block;
    }
    
    .tool-workspace {
        flex-direction: column;
    }
    
    .tool-sidebar {
        width: 100%;
    }
}
