/* ==========================================
   Reset & Base Styles
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-color: #f7fafc;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================
   Header & Navigation
   ========================================== */
header {
    background-color: #1a202c;
    color: #fff;
    padding: 1rem 2rem;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    position: relative; /* Context for absolute positioning on mobile */
}

.logo {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Desktop Navigation Links */
.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: #e2e8f0;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #3182ce;
}

/* ==========================================
   Mobile Hamburger Toggle & Morphing 'X'
   ========================================== */
.menu-toggle {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101; /* Keeps button accessible above dropdown */
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform-origin: center;
}

/* Morphing into 'X' state */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Responsive Mobile Navigation (< 768px) */
@media (max-width: 767px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%; /* Drops down directly under header */
        left: 0;
        background-color: #1a202c;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
        z-index: 100;
    }

    .nav-links a {
        margin: 0;
        padding: 0.75rem 2rem;
        width: 100%;
        display: block;
        border-top: 1px solid #2d3748;
    }

    .nav-links.active {
        display: flex;
    }
}

/* ==========================================
   Main Layout & Content
   ========================================== */
main.container {
    max-width: 1100px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
}

h2 {
    margin-bottom: 1.5rem;
    color: #1a202c;
	text-align: center;
}

/* ==========================================
   Product Cards Grid
   ========================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	justify-content: center;
    gap: 1.5rem;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.product-card p {
    color: #4a5568;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background-color: #3182ce;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2b6cb0;
}

.btn-success {
    background-color: #38a169;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #2f855a;
}

/* ==========================================
   Forms & Inputs
   ========================================== */
.form-container {
    max-width: 500px;
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

/* ==========================================
   Alerts
   ========================================== */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background-color: #c6f6d5;
    color: #22543d;
}

.alert-error {
    background-color: #fed7d7;
    color: #742a2a;
}

/* ==========================================
   Footer
   ========================================== */
footer {
    background-color: #edf2f7;
    text-align: center;
    padding: 1.5rem;
    color: #718096;
    font-size: 0.9rem;
}

* Product Dropdown Styles */
.os-selector {
    margin-bottom: 1.25rem;
}

.os-selector label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.35rem;
}

.os-dropdown {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background-color: #f8fafc;
    color: #2d3748;
    font-size: 0.95rem;
    cursor: pointer;
}

.os-dropdown:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

/* Ensure full width download buttons inside cards */
.product-card .btn {
    width: 100%;
    margin-top: 0.5rem;
}
/* Disabled Button Styling */
.btn-disabled {
    background-color: #cbd5e0;
    color: #718096;
    cursor: not-allowed;
    pointer-events: none; /* Prevents click interaction */
    box-shadow: none;
}

.btn-disabled:hover {
    background-color: #cbd5e0;
}

/* Coming Soon Status Message */
.coming-soon-msg {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: #feebc8;
    color: #744210;
    border: 1px solid #fbd38d;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

/* Helper Class to Toggle Visibility */
.hidden {
    display: none !important;
}

/* ==========================================
   Showcase Section & Dividers
   ========================================== */
.showcase-section {
    margin-top: 3rem;
}

.section-divider {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin-bottom: 2.5rem;
}

.showcase-subtitle {
    text-align: center;
    color: #4a5568;
    margin-top: -1rem;
    margin-bottom: 2rem;
}

.subsection-title {
    font-size: 1.25rem;
    color: #2d3748;
    margin-bottom: 1.25rem;
    border-left: 4px solid #3182ce;
    padding-left: 0.75rem;
}

/* ==========================================
   Grids (4-Col and 3-Col)
   ========================================== */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ==========================================
   Showcase Layouts & Multi-Column Spans
   ========================================== */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* Explicit Column Spanning Rules */
.span-1 {
    grid-column: span 1;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

/* ==========================================
   Image Container & Aspect Ratio Adjustments
   ========================================== */
.showcase-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.showcase-card .img-wrapper {
    background-color: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

/* Fix for cut-off edges: Use object-fit: contain so full UI remains visible */
.showcase-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; 
    display: block;
}

/* Aspect ratio defaults for different UI types */
.img-wrapper.ratio-wide {
    height: 320px; /* Gives full desktop screens room to render cleanly */
}

.img-wrapper.ratio-portrait {
    height: 320px; /* Gives narrow toolbars & mobile screens clean framing */
}

.showcase-card h4 {
    font-size: 1.1rem;
    color: #1a202c;
    margin-bottom: 0.4rem;
}

.showcase-card p {
    font-size: 0.88rem;
    color: #718096;
    line-height: 1.4;
}

/* ==========================================
   Responsive Breakpoints for Mobile/Tablets
   ========================================== */
@media (max-width: 992px) {
    /* Collapse to 2-column layout on tablets */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .span-3,
    .span-1 {
        grid-column: span 2; /* Stretch across both columns on tablet */
    }

    .img-wrapper.ratio-wide,
    .img-wrapper.ratio-portrait {
        height: 250px;
    }
}

@media (max-width: 600px) {
    /* Single column stack on phones */
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .span-3,
    .span-1 {
        grid-column: span 1;
    }

    .img-wrapper.ratio-wide,
    .img-wrapper.ratio-portrait {
        height: 200px;
    }
}

/* Compact Manual Reader Page */
.reader-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 10px;
}

.reader-container {
    width: 100% !important;
    max-width: 800px !important; /* Constrains max width */
    margin: 0 auto !important;   /* Centers horizontally */
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px 25px;
    box-sizing: border-box;
}

.reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #edf2f7;
}

.back-link {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
}

.manual-content h1 {
    font-size: 1.65rem;
    margin-bottom: 6px;
}

.manual-content p, 
.manual-content li {
    font-size: 0.975rem;
    line-height: 1.65;
    color: #2d3748;
}
/* Tips callout box */
.alert-info {
    background-color: #ebf8ff; /* Soft blue */
    border-left: 4px solid #3182ce; /* Bright blue accent */
    color: #2c5282;
    padding: 14px 18px;
    border-radius: 6px;
    margin: 18px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Warning callout box */
.alert-warning {
    background-color: #fffaf0; /* Warm subtle yellow background */
    border-left: 4px solid #dd6b20; /* Vibrant orange border for high contrast */
    color: #7b341e; /* Dark readable text */
    padding: 14px 18px;
    border-radius: 6px;
    margin: 18px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert-warning strong {
    color: #9c4221;
}
