/* styles.css - The RapidTools Brand */
:root {
    --primary: #2563eb; /* Professional Tech Blue */
    --dark: #1e293b;
    --light: #f8fafc;
    --text: #334155;
    --white: #ffffff;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--light);
    color: var(--text);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

* {
    box-sizing: border-box; /* Fix width issues */
}

img {
    max-width: 100%; /* Prevent images from overflowing */
    height: auto;
}

/* --- NAVIGATION FIX STARTS HERE --- */

/* Hamburger Menu Button (Mobile Only) */
.hamburger {
    display: none !important; /* Hidden on desktop - use !important to ensure it takes precedence */
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

@media (min-width: 769px) {
    .hamburger {
        display: none !important; /* Extra safety: force hide on desktop */
    }
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* The background strip (Stretches edge-to-edge) */
header {
    background: var(--white);
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
    /* Removed padding from here so the background stays full width */
}

/* The inner container (Centers the logo and text) */
.header-content {
    max-width: 1000px; /* MATCHES YOUR TOOL GRID WIDTH */
    margin: 0 auto;    /* Centers the invisible box */
    padding: 1rem 1rem; 
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* --- NAVIGATION FIX ENDS HERE --- */

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--dark);
    text-decoration: none;
}

.logo span { color: var(--primary); }

/* The Grid of Tools */
.container {
    max-width: 1000px; /* MATCHES NAV WIDTH */
    margin: 3rem auto;
    padding: 0 1rem;
}

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

/* Tool Cards */
.tool-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    text-decoration: none;
    color: var(--text);
    border: 1px solid #e2e8f0;
    display: block;
}

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

.tool-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--dark);
}

.tool-card p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    color: #64748b;
    font-size: 0.9rem;
}
/* ========================================
   MOBILE OPTIMIZATION - RESPONSIVE STYLES
   ======================================== */

/* Mobile Breakpoints */
@media (max-width: 768px) {
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Container & Spacing */
    .container {
        padding: 20px 15px;
        width: 100%;
        max-width: 100%;
    }
    
    /* Header Mobile */
    .header-content {
        flex-direction: row; /* Keep logo and hamburger on same line */
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        position: relative;
    }
    
    .logo {
        font-size: 1.3rem;
        z-index: 1001;
    }
    
    /* Show Hamburger Menu Button on Mobile */
    .hamburger {
        display: flex !important;
    }
    
    /* Navigation Mobile - Hidden by default */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%; /* Hidden off-screen */
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 80px 20px 20px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 1000;
    }
    
    /* Show navigation when active */
    .main-nav.active {
        right: 0;
    }
    
    .main-nav > a,
    .main-nav > .dropdown {
        display: block;
        padding: 15px 10px;
        border-bottom: 1px solid #e2e8f0;
        text-align: left;
        width: 100%;
    }
    
    .main-nav > a:hover {
        background: var(--light);
    }
    
    /* Dropdown Mobile */
    .dropdown-toggle {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        margin-top: 10px;
        padding-left: 15px;
        display: none;
        background: var(--light);
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a {
        padding: 12px 10px;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .dropdown-menu a:last-child {
        border-bottom: none;
    }
    
    /* Typography Mobile */
    h1 {
        font-size: 1.8rem !important;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.4rem !important;
    }
    
    h3 {
        font-size: 1.2rem !important;
    }
    
    .page-header h1 {
        font-size: 1.8rem !important;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    /* Tool Grid Mobile */
    .tool-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .tool-card {
        padding: 25px 20px;
    }
    
    .tool-icon {
        font-size: 2.5rem;
    }
    
    /* Features Grid Mobile */
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    /* Buttons Mobile - Touch Friendly */
    .action-btn,
    button {
        padding: 16px 30px !important;
        font-size: 1rem !important;
        min-height: 48px; /* Touch target */
    }
    
    /* Forms Mobile */
    input[type="text"],
    input[type="number"],
    input[type="file"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Drop Zone Mobile */
    .drop-zone {
        height: 150px;
        padding: 20px;
    }
    
    .drop-zone p {
        font-size: 1rem;
    }
    
    .drop-zone span {
        font-size: 0.85rem;
    }
    
    /* Settings Grid Mobile */
    .settings-grid,
    .compression-options {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    /* File List Mobile */
    .file-card {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .file-actions {
        width: 100%;
        justify-content: center;
    }
    
    /* Preview Grid Mobile */
    .preview-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Tables Mobile - Horizontal Scroll */
    .comparison-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .comparison-table table {
        min-width: 600px;
    }
    
    /* SEO Content Mobile */
    .seo-content {
        padding: 25px 20px;
    }
    
    .seo-content h2 {
        font-size: 1.5rem;
    }
    
    .seo-content h3 {
        font-size: 1.2rem;
    }
    
    /* FAQ Section Mobile */
    .faq-section {
        padding: 20px 15px;
    }
    
    .faq-question {
        font-size: 1rem;
    }
    
    .faq-answer {
        font-size: 0.9rem;
    }
    
    /* Footer Mobile */
    .footer-container {
        padding: 30px 15px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 25px;
        text-align: center;
    }
    
    .footer-col {
        text-align: center;
    }
    
    .footer-col ul {
        padding-left: 0;
        list-style: none;
    }
    
    /* Badge Mobile */
    .badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    /* Section Cards Mobile */
    .section-card,
    .info-section {
        padding: 20px 15px;
    }
    
    /* Breadcrumb Mobile */
    .breadcrumb {
        font-size: 0.8rem;
        padding: 10px 0;
    }
    
    /* File Info Grid Mobile */
    .file-info-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    /* Status Text Mobile */
    #status {
        font-size: 0.9rem;
    }
    
    /* Prevent all width overflow issues */
    img, video, iframe, embed, object {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Ensure all containers respect screen width */
    .page-header,
    .tool-container,
    .calc-container,
    .info-section,
    .faq-section {
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: hidden !important;
    }
    
    /* Fix any tables that might overflow */
    table {
        width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
    }
    
    /* Prevent text from causing overflow */
    pre, code {
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        overflow-x: auto !important;
    }
}

/* Tablet Breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
    
    .container {
        padding: 30px 40px;
    }
    
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* Small Mobile (320px) */
@media (max-width: 380px) {
    
    .logo {
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: 1.5rem !important;
    }
    
    .action-btn {
        padding: 14px 20px !important;
        font-size: 0.9rem !important;
    }
    
    .tool-card {
        padding: 20px 15px;
    }
    
    .seo-content {
        padding: 20px 15px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    
    /* Larger tap targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Prevent text selection on buttons */
    button {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        user-select: none;
    }
    
    /* Better spacing for touch */
    .file-actions button {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    
    .page-header {
        padding: 25px 20px;
    }
    
    .drop-zone {
        height: 120px;
    }
    
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print Styles */
@media print {
    
    header,
    footer,
    .action-btn,
    .drop-zone,
    #status {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        box-shadow: none;
    }
    
    .seo-content {
        page-break-inside: avoid;
    }
}
