/* Reset and base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo a {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.logo i {
    margin-right: 10px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
    font-size: 0.95rem;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Mobile menu */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    transition: transform 0.3s, box-shadow 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.tool-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #e9ecef;
    color: #333;
}

.btn-secondary:hover {
    background: #dee2e6;
}

/* Tool Pages */
.tool-container {
    padding: 2rem 0;
}

.tool-container h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-description {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.upload-area:hover {
    border-color: #667eea;
}

.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-content {
    color: #666;
}

.upload-content i {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.upload-content input[type="file"] {
    display: none;
}

/* Controls */
.controls {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.control-group input[type="range"] {
    width: 100%;
    max-width: 300px;
}

.control-group input[type="number"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 100%;
    max-width: 150px;
}

.control-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 100%;
    max-width: 200px;
}

.control-group span {
    margin-left: 0.5rem;
    color: #667eea;
    font-weight: bold;
}

/* Progress */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    width: 0%;
}

#progressText {
    text-align: center;
    color: #666;
}

/* Results */
.result-success {
    text-align: center;
    padding: 2rem;
    background: #d4edda;
    border-radius: 12px;
    color: #155724;
}

.result-success i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-success h3 {
    margin-bottom: 0.5rem;
}

.result-success .btn {
    margin: 0.5rem;
}

/* Ads */
.ad-container {
    margin: 2rem 0;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    min-height: 100px;
}

/* Footer */
footer {
    background: #2d3748;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #a0aec0;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #4a5568;
    color: #a0aec0;
}

/* Footer Styles - Enhanced */
footer {
    background: #1a202c;
    color: white;
    padding: 4rem 0 1rem;
    margin-top: 3rem;
    border-top: 4px solid linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.footer-section h3 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.footer-section h4 {
    color: #e2e8f0;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.footer-section p {
    color: #a0aec0;
    line-height: 1.8;
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.7rem;
}

.footer-section ul li a {
    color: #a0aec0;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.footer-section ul li a i {
    margin-right: 0.5rem;
    color: #667eea;
    transition: all 0.3s;
}

.footer-section ul li a:hover {
    color: white;
    padding-left: 0.5rem;
}

.footer-section ul li a:hover i {
    margin-right: 0.8rem;
}

.footer-bottom {
    border-top: 1px solid #2d3748;
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: #718096;
    font-size: 0.95rem;
}

/* PDF to Word Specific Styles */
.control-group select {
    padding: 0.6rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
    transition: border-color 0.3s;
}

.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

#ocrSettings {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0f4ff;
    border-radius: 8px;
    border: 1px solid #d4e0ff;
}

#result .result-success ul {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

#result .result-success ul li {
    margin: 0.3rem 0;
}

/* File info styling */
#fileInfo {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
}

#fileInfo p {
    margin: 0.3rem 0;
}

#fileInfo span {
    color: #667eea;
    font-weight: 500;
}

/* Document preview button */
.btn-secondary i {
    margin-right: 0.5rem;
}



/* Back to Top Button */
#backToTop {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    padding: 15px 18px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
}

#backToTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#backToTop i {
    font-size: 1.2rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block !important;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 1rem 0;
        gap: 0.5rem;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 0.5rem 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    #backToTop {
        bottom: 20px;
        right: 20px;
        padding: 12px 15px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .footer-section {
        text-align: center;
    }
    
    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
}


/* Responsive */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 2rem;
    }
    
    .controls {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .upload-area {
        padding: 1.5rem;
    }
}