/* ===================================
   Global Styles & Variables
   =================================== */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1e293b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --max-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

/* ===================================
   Navigation
   =================================== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

#navbar.scrolled {
    box-shadow: var(--shadow-md);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after {
    width: 100%;
}

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

/* ===================================
   Hero Section
   =================================== */
.hero {
    margin-top: 80px;
    padding: var(--spacing-xl) 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    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"><rect width="100" height="100" fill="none"/><path d="M0 0L50 50L0 100L50 50L100 100L50 50L100 0L50 50L0 0Z" stroke="rgba(255,255,255,0.1)" stroke-width="1" fill="none"/></svg>');
    opacity: 0.1;
}

.hero-content {
    max-width: 600px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-features {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.feature-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.privacy-message {
    background: rgba(255, 255, 255, 0.15);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.cta-button {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.hero-image {
    display: none;
}

.floating-card {
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.2);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* ===================================
   Tools Overview Grid
   =================================== */
.tools-overview {
    padding: var(--spacing-xl) 2rem;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    border: 2px solid transparent;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.tool-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tool-card p {
    color: var(--text-secondary);
}

/* ===================================
   Tool Sections
   =================================== */
.tool-section {
    padding: var(--spacing-xl) 2rem;
    min-height: 100vh;
}

.tool-section.alt-bg {
    background-color: var(--bg-secondary);
}

.tool-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.tool-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tool-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tool-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.tool-workspace {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   Upload Zone
   =================================== */
.upload-zone {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.upload-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.02);
}

.upload-zone i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-zone h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-zone p {
    color: var(--text-secondary);
}

/* ===================================
   Files List
   =================================== */
.files-list {
    margin-top: 2rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.file-item:hover {
    background: #e0e7ff;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.file-details h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.file-details p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.btn-icon.btn-danger:hover {
    color: var(--danger-color);
}

/* ===================================
   Tool Actions
   =================================== */
.tool-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-premium {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

.btn-premium {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ===================================
   Progress Container
   =================================== */
.progress-container {
    margin-top: 2rem;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 50px;
    transition: width 0.3s ease;
    width: 0%;
    animation: progress-animation 2s ease-in-out infinite;
}

@keyframes progress-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.progress-text {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===================================
   Tool-Specific Styles
   =================================== */

/* Split PDF */
.split-preview {
    margin-top: 2rem;
}

.split-options {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.split-options label {
    display: block;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.split-options input[type="radio"] {
    margin-right: 0.5rem;
}

.input-group {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

/* Compress PDF */
.compress-preview {
    margin-top: 2rem;
}

.compression-options {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.compression-options label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.compression-options select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.compress-result {
    background: #dcfce7;
    border: 2px solid var(--success-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.compress-result .savings {
    color: var(--success-color);
    font-size: 1.25rem;
    font-weight: 700;
}

/* PDF to Image */
.pdf-to-image-preview {
    margin-top: 2rem;
}

.conversion-options {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.option-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.info-text {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Image to PDF */
.image-to-pdf-options {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Rotate/Rearrange */
.rotate-preview {
    margin-top: 2rem;
}

.rotate-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    align-items: center;
}

.rotate-controls .divider {
    color: var(--border-color);
    font-size: 1.5rem;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.page-item {
    position: relative;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    cursor: move;
    transition: var(--transition);
}

.page-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.page-item.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.page-thumbnail {
    width: 100%;
    height: 200px;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.page-thumbnail canvas {
    max-width: 100%;
    max-height: 100%;
}

.page-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.page-actions {
    display: flex;
    gap: 0.25rem;
}

/* ===================================
   Premium CTA Section
   =================================== */
.premium-cta {
    padding: var(--spacing-xl) 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.premium-features {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.premium-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.premium-features i {
    color: var(--success-color);
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: var(--spacing-xl) 2rem 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--text-light);
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-features {
        flex-direction: column;
        align-items: stretch;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .tool-header h2 {
        font-size: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-workspace {
        padding: 1.5rem;
    }
    
    .conversion-options,
    .image-to-pdf-options {
        grid-template-columns: 1fr;
    }
    
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .nav-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .tool-section {
        padding: 2rem 1rem;
    }
    
    .tool-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   Utility Classes
   =================================== */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
