/* ===== RECIPE TOOLS E PRINT BUTTON ===== */

/* Recipe Tools Container */
.recipe-tools {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tools-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #ffffff;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tool-btn:hover {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
    text-decoration: none;
}

.tool-btn:active {
    transform: translateY(0);
}

/* Print Recipe Section */
.print-recipe-section {
    margin: 25px 0;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffffff 100%);
    border: 2px dashed #ff6b35;
    border-radius: 12px;
}

.print-recipe-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    min-height: 48px;
}

.print-recipe-button:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.print-recipe-button:active {
    transform: translateY(0);
}

.print-icon {
    font-size: 18px;
}

.print-text {
    font-size: 16px;
}

/* Ingredient Completed State */
.ingredient-completed {
    opacity: 0.6;
}

.ingredient-completed .ingredient-text {
    text-decoration: line-through;
    color: #6c757d;
}

.ingredient-completed::before {
    background: #28a745 !important;
    border-color: #28a745 !important;
}

/* Recipe Lightbox */
.recipe-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    cursor: default;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: -40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #333;
}

.lightbox-close:hover {
    background: white;
    transform: scale(1.1);
}

/* Body quando lightbox è aperto */
body.lightbox-open {
    overflow: hidden;
}

/* FAQ Styles Enhancement */
.faq-item {
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.faq-question {
    margin: 0;
}

.faq-toggle {
    width: 100%;
    background: #f8f9fa;
    border: none;
    padding: 15px 20px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
}

.faq-toggle:hover {
    background: #e9ecef;
    color: #ff6b35;
}

.faq-toggle[aria-expanded="true"] {
    background: #ff6b35;
    color: white;
}

.faq-icon {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.question-text {
    flex: 1;
    line-height: 1.4;
}

.faq-answer {
    border-top: 1px solid #e9ecef;
}

.answer-content {
    padding: 20px;
    color: #495057;
    line-height: 1.6;
}

.answer-content p:last-child {
    margin-bottom: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .recipe-tools {
        margin: 15px 0;
        padding: 12px;
    }
    
    .tools-container {
        gap: 8px;
    }
    
    .tool-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 44px;
    }
    
    .print-recipe-section {
        margin: 20px 0;
        padding: 15px;
    }
    
    .print-recipe-button {
        padding: 10px 20px;
        font-size: 15px;
        min-height: 44px;
    }
    
    .print-icon {
        font-size: 16px;
    }
    
    .print-text {
        font-size: 15px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .faq-toggle {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .answer-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .tools-container {
        flex-direction: column;
        align-items: center;
    }
    
    .tool-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .print-recipe-button {
        width: 100%;
        max-width: 250px;
    }
    
    .faq-toggle {
        padding: 10px 12px;
        font-size: 14px;
        gap: 8px;
    }
    
    .answer-content {
        padding: 12px;
    }
}

/* ===== PRINT SPECIFIC ===== */
@media print {
    /* CONFIGURAZIONE PAGINA */
    @page {
        size: A4 portrait;
        margin: 15mm;
        background: white !important;
    }
    
    /* RESET RADICALE PER BYPASSARE ERRORI JS */
    * {
        visibility: visible !important;
        display: revert !important;
        position: static !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
        background: white !important;
        color: #333 !important;
    }
    
    /* NASCONDERE ELEMENTI NON NECESSARI */
    #wpadminbar, header, footer, nav, aside, .sidebar,
    .ricetta-sidebar, .ricetta-navigation-section,
    .ricetta-breadcrumb, .qdb-social-minimal,
    .comments-area, script, style, .hamburger-menu-toggle,
    .site-header, .site-footer-custom {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* FORZA VISUALIZZAZIONE CONTENUTO PRINCIPALE */
    html, body {
        background: white !important;
        color: #333 !important;
        font-family: Arial, sans-serif !important;
        font-size: 11pt !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .ricetta-container-custom {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 20pt !important;
        background: white !important;
    }
    
    .ricetta-main-content {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
    }
    
    /* STILI SPECIFICI PER STAMPA */
    h1, .ricetta-title { 
        font-size: 18pt !important;
        color: #333 !important;
        margin-bottom: 15pt !important;
    }
    
    h2 { 
        font-size: 14pt !important;
        color: #333 !important;
        margin: 15pt 0 10pt 0 !important;
    }
    
    p, .step-text {
        font-size: 10pt !important;
        color: #333 !important;
        line-height: 1.4 !important;
        margin: 8pt 0 !important;
    }
    
    .ingrediente-item {
        font-size: 10pt !important;
        color: #333 !important;
        margin: 4pt 0 !important;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid !important;
    }
}

/* ===== ACCESSIBILITY ===== */
.tool-btn:focus,
.print-recipe-button:focus,
.faq-toggle:focus,
.lightbox-close:focus {
    outline: 3px solid #ff6b35;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .tool-btn,
    .print-recipe-button,
    .faq-toggle {
        border: 2px solid #000000;
        background: #ffffff;
        color: #000000;
    }
    
    .tool-btn:hover,
    .print-recipe-button:hover,
    .faq-toggle:hover {
        background: #000000;
        color: #ffffff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tool-btn,
    .print-recipe-button,
    .faq-toggle,
    .lightbox-close {
        transition: none;
    }
    
    .tool-btn:hover,
    .print-recipe-button:hover {
        transform: none;
    }
}