/* ============================================
   ATOZ PDF TOOLS - MASTER STYLESHEET
   Version: 1.0.0
   Author: Virendra Singh Bhagwati
   Description: Complete, error-free CSS for all pages
============================================ */

/* ============================================
   1. RESET & BASE STYLES
============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   2. TYPOGRAPHY
============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #333;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

a {
    color: #667eea;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #764ba2;
}

ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ============================================
   3. HEADER & NAVIGATION
============================================ */

.header {
    background: rgba(255, 255, 255, 0.98);
    padding: 0.5rem 2rem;   /* 👈 HEIGHT FIX */
    height: 72px;           /* 👈 HARD LIMIT */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    flex-direction: row;    /* 👈 MOST IMPORTANT FIX */
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;        /* 👈 HEADER HEIGHT CONTROL */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: #333;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #667eea;
}

/* ============================================
   4. BUTTONS
============================================ */

.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    display: inline-block;
    text-align: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #f0f2ff;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* ============================================
   5. AUTH BUTTONS
============================================ */

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.btn-login {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-login:hover {
    background: #f0f2ff;
}

.btn-signup {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-logout {
    background: #dc3545;
    color: white;
}

.btn-logout:hover {
    background: #c82333;
}

/* ============================================
   6. USER MENU
============================================ */

.user-menu {
    display: none;
    align-items: center;
    gap: 1rem;
}

.user-menu.active {
    display: flex;
}

.user-avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 1rem;
    background: #f8f9ff;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-avatar-wrapper:hover {
    background: #f0f2ff;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

/* ============================================
   7. HERO SECTION
============================================ */

.hero,
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero h1,
.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p,
.hero-section p {
    font-size: 1.3rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ============================================
   8. CONTAINER & LAYOUT
============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.tools-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px 20px 0 0;
}

/* ============================================
   9. SECTIONS
============================================ */

.section-title {
    text-align: center;
    font-size: 2rem;
    color: #333;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* ============================================
   10. TOOL CARDS
============================================ */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.tool-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ============================================
   11. BADGES
============================================ */

.badge {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

/* ============================================
   12. FEATURES SECTION
============================================ */

.features {
    background: #f8f9fa;
    padding: 3rem 2rem;
}

.feature-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.feature-item h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature-item p {
    color: #666;
    line-height: 1.6;
}

/* ============================================
   13. MODAL
============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
    text-align: center;
}

.modal-subtitle {
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 0.95rem;
}

/* ============================================
   14. FORMS & INPUTS
============================================ */

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================
   15. UPLOAD AREA
============================================ */

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-area:hover {
    background: #f0f2ff;
    border-color: #764ba2;
    transform: scale(1.02);
}

.upload-area.dragover {
    background: #e8ebff;
    border-color: #764ba2;
    transform: scale(1.05);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.upload-subtext {
    font-size: 1rem;
    color: #666;
}

.file-input {
    display: none;
}

/* ============================================
   16. BACK LINK
============================================ */

.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    margin-bottom: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: #764ba2;
    transform: translateX(-5px);
}

/* ============================================
   17. NOTIFICATIONS & STATUS
============================================ */

.status {
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    font-weight: 600;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #0c5460;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #155724;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #721c24;
}

.status.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #856404;
}

.status.processing {
    background: #fff3cd;
    color: #856404;
}

/* ============================================
   18. SPINNER / LOADER
============================================ */

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   19. DIVIDER
============================================ */

.divider {
    text-align: center;
    margin: 1.5rem 0;
    color: #999;
    position: relative;
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e0e0e0;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

/* ============================================
   20. FOOTER
============================================ */

footer {
    background: #2d3748;
    color: white;
    padding: 3rem 2rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 0.8rem;
}

.footer-column ul li a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-column ul li a:hover {
    color: #fff;
}

.footer-about {
    color: #cbd5e0;
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #4a5568;
    color: #cbd5e0;
}

.footer-bottom p {
    margin: 0.5rem 0;
}

/* ============================================
   21. UTILITY CLASSES
============================================ */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ============================================
   22. ANIMATIONS
============================================ */

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ============================================
   23. RESPONSIVE DESIGN
============================================ */

@media (max-width: 1200px) {
    .container,
    .tools-container {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 968px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    .header {
        flex-direction: row;
        gap: 1rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero h1,
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .header {
        padding: 1rem;
    }
    
    .hero,
    .hero-section {
        padding: 3rem 1.5rem;
    }
    
    .container,
    .tools-container {
        padding: 2rem 1rem;
    }
    
    .modal-content {
        padding: 2rem;
        width: 95%;
    }
    
    .user-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
}

/* ============================================
   24. PRINT STYLES
============================================ */

@media print {
    .header,
    .footer,
    .modal,
    .btn,
    .upload-area {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* ============================================
   25. ACCESSIBILITY
============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* ============================================
   26. SCROLLBAR STYLING
============================================ */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

/* ============================================
   27. SELECTION STYLING
============================================ */

::selection {
    background: #667eea;
    color: white;
}

::-moz-selection {
    background: #667eea;
    color: white;
}

/* ============================================
   END OF STYLESHEET
============================================ */