/* ============================================
   Free Worksheet Generator Tools - Styles
   ============================================ */

/* Tool landing page */
.tools-hero {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}
.tools-hero h1 { font-weight: 800; }
.tools-hero p { opacity: 0.9; max-width: 600px; margin: 0 auto; }

.tool-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(124,58,237,0.18);
}
.tool-card .card-body { padding: 1.5rem; }
.tool-card .tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}
.tool-card h5 { font-weight: 700; font-size: 1.05rem; }
.tool-card p { font-size: 0.88rem; color: #6b7280; }
.tool-card .btn {
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Tool page layout */
.tool-page { padding: 2rem 0 3rem; }
.tool-page h1 {
    font-weight: 800;
    font-size: 1.75rem;
    color: #1f2937;
}
.tool-page .tool-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Controls panel */
.tool-controls {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
}
.tool-controls h5 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #374151;
}
.tool-controls label {
    font-weight: 600;
    font-size: 0.82rem;
    color: #4b5563;
    margin-bottom: 0.25rem;
}
.tool-controls .form-control,
.tool-controls .form-select {
    font-size: 0.88rem;
    border-radius: 8px;
    border-color: #d1d5db;
}
.tool-controls .form-control:focus,
.tool-controls .form-select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.tool-controls .form-range::-webkit-slider-thumb {
    background: #7c3aed;
}

/* Action buttons */
.tool-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.tool-actions .btn {
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
    padding: 0.5rem 1rem;
}
.btn-generate {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
}
.btn-generate:hover {
    background: linear-gradient(135deg, #6d28d9, #9333ea);
    color: #fff;
}

/* Canvas preview area */
.preview-area {
    background: #f3f4f6;
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    min-height: 400px;
}
.preview-area canvas {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    max-width: 100%;
    height: auto !important;
    border-radius: 4px;
}
.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #9ca3af;
}
.preview-placeholder i { font-size: 3rem; margin-bottom: 0.75rem; }
.preview-placeholder p { font-size: 0.9rem; }

/* Page navigation for multi-page */
.page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.page-nav .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}
.page-nav span {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
}

/* SEO content below tool */
.tool-seo-content {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}
.tool-seo-content h2 {
    font-weight: 700;
    font-size: 1.35rem;
    color: #1f2937;
}
.tool-seo-content h3 {
    font-weight: 600;
    font-size: 1.1rem;
    color: #374151;
}
.tool-seo-content p,
.tool-seo-content li {
    color: #4b5563;
    font-size: 0.92rem;
    line-height: 1.7;
}

/* Cross-links */
.tool-cross-links {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}
.tool-cross-links h5 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* CTA banner */
.tool-cta {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    border-radius: 16px;
    padding: 2rem;
    color: #fff;
    text-align: center;
    margin-top: 2rem;
}
.tool-cta h4 { font-weight: 700; color: #fff; }
.tool-cta p { opacity: 0.9; color: #fff; }
.tool-cta .btn {
    background: #fff;
    color: #7c3aed;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
}
.tool-cta .btn:hover { background: #f3f4f6; color: #6d28d9; }

/* Upsell elements */
.upsell-sidebar {
    background: linear-gradient(135deg, #faf5ff 0%, #fdf2f8 100%);
    border: 2px solid #e9d5ff;
    border-radius: 14px;
    padding: 1.25rem;
    margin-top: 1rem;
    text-align: center;
}
.upsell-sidebar .upsell-badge {
    display: inline-block;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}
.upsell-sidebar h6 {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1f2937;
    margin-bottom: 0.4rem;
}
.upsell-sidebar p {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.upsell-sidebar .btn-upsell {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    width: 100%;
    transition: transform 0.15s;
}
.upsell-sidebar .btn-upsell:hover {
    transform: scale(1.02);
    background: linear-gradient(135deg, #6d28d9, #9333ea);
    color: #fff;
}
.upsell-sidebar .upsell-features {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
    text-align: left;
}
.upsell-sidebar .upsell-features li {
    font-size: 0.78rem;
    color: #4b5563;
    padding: 0.15rem 0;
}
.upsell-sidebar .upsell-features li i {
    color: #10b981;
    margin-right: 0.3rem;
}

.upsell-inline {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.upsell-inline i.upsell-icon {
    font-size: 2rem;
    color: #f59e0b;
    flex-shrink: 0;
}
.upsell-inline .upsell-text h6 {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
    color: #92400e;
}
.upsell-inline .upsell-text p {
    font-size: 0.8rem;
    color: #78350f;
    margin-bottom: 0;
}
.upsell-inline .btn {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.upsell-banner-below {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    color: #fff;
    text-align: center;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}
.upsell-banner-below::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.upsell-banner-below h3 { font-weight: 800; font-size: 1.3rem; }
.upsell-banner-below p { opacity: 0.92; font-size: 0.92rem; max-width: 500px; margin: 0.5rem auto; }
.upsell-banner-below .btn {
    background: #fff;
    color: #7c3aed;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 2rem;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}
.upsell-banner-below .btn:hover { background: #f3f4f6; }
.upsell-banner-below .upsell-guarantee {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Letter grid for alphabet tool */
.letter-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
}
.letter-grid .letter-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #374151;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.letter-grid .letter-btn.active {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}
.letter-grid .letter-btn:hover:not(.active) {
    border-color: #7c3aed;
    color: #7c3aed;
}

/* Flashcard grid labels */
.flashcard-input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}
.flashcard-input-row input {
    flex: 1;
}
.flashcard-input-row .btn-remove {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Mobile responsive */
@media (max-width: 991.98px) {
    .tool-controls {
        margin-bottom: 1.5rem;
    }
    .tool-page h1 { font-size: 1.4rem; }
    .letter-grid { grid-template-columns: repeat(7, 1fr); }
}
@media (max-width: 575.98px) {
    .tool-actions { flex-direction: column; }
    .tool-actions .btn { width: 100%; }
    .letter-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ============================================
   Print Styles - Only show the worksheet
   ============================================ */
@media print {
    /* Hide everything except the canvas */
    body > *:not(.print-canvas-wrapper) {
        display: none !important;
    }
    .navbar, footer, .tool-controls, .tool-actions,
    .tool-seo-content, .tool-cross-links, .tool-cta,
    .page-nav, .preview-area > p, #promo-banner,
    #coupon-banner, #cart-reminder-bar, #exitIntentModal,
    section, .tools-hero, .breadcrumb, .print-hide {
        display: none !important;
    }
    .main-content { padding: 0 !important; margin: 0 !important; }
    .preview-area {
        background: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    .preview-area canvas {
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
        page-break-after: always;
    }
    @page {
        margin: 0.5in;
        size: letter portrait;
    }
}
