/* ==========================================================================
   LGGF AI Recipe Generator - Styles
   ========================================================================== */

#lggf-recipe-generator-wrap {
    max-width: 780px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #2d3436;
}

/* Card container */
.lggf-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Form elements */
.lggf-form-group {
    margin-bottom: 20px;
}

.lggf-form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #1a1a2e;
}

.lggf-form-row {
    display: flex;
    gap: 16px;
}

.lggf-half {
    flex: 1;
}

.lggf-form-group select,
.lggf-form-group input[type="number"],
.lggf-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    color: #2d3436;
    box-sizing: border-box;
}

.lggf-form-group select:focus,
.lggf-form-group input:focus,
.lggf-form-group textarea:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
    background: #fff;
}

.lggf-form-group textarea {
    resize: vertical;
    min-height: 50px;
}

/* Checkbox */
.lggf-checkbox-group {
    margin-top: 4px;
}

.lggf-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 400 !important;
}

.lggf-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: #2d6a4f;
    flex-shrink: 0;
}

.lggf-checkbox-text {
    font-size: 15px;
    color: #374151;
}

.lggf-checkbox-text small {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px;
}

/* Buttons */
.lggf-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: #2d6a4f;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.lggf-btn-primary:hover {
    background: #1b4332;
}

.lggf-btn-primary:active {
    transform: scale(0.98);
}

.lggf-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.lggf-btn-secondary,
.lggf-btn-outline,
.lggf-btn-pinterest {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    border: 1.5px solid #d1d5db;
    background: #fff;
    color: #374151;
}

.lggf-btn-secondary:hover,
.lggf-btn-outline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.lggf-btn-pinterest {
    background: #E60023;
    color: #fff;
    border-color: #E60023;
}

.lggf-btn-pinterest:hover {
    background: #ad081b;
    border-color: #ad081b;
}

/* Spinner animation (button only) */
.lggf-spinner {
    animation: lggf-spin 0.8s linear infinite;
}

@keyframes lggf-spin {
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   COOKING SCENE ANIMATION
   ========================================================================== */

.lggf-loading-content {
    text-align: center;
    padding: 32px 20px 24px;
}

.lggf-cooking-scene {
    position: relative;
    width: 160px;
    height: 140px;
    margin: 0 auto 20px;
}

/* Pot body */
.lggf-pot {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
}

.lggf-pot-body {
    width: 90px;
    height: 56px;
    background: linear-gradient(135deg, #6b7280, #4b5563);
    border-radius: 0 0 18px 18px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 -8px 16px rgba(0,0,0,0.15);
}

.lggf-pot-handle-l,
.lggf-pot-handle-r {
    position: absolute;
    top: 10px;
    width: 14px;
    height: 10px;
    background: #9ca3af;
    border-radius: 3px;
}

.lggf-pot-handle-l { left: -14px; }
.lggf-pot-handle-r { right: -14px; }

/* Bubbles inside pot */
.lggf-bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    animation: lggf-bubble-up 1.8s ease-in-out infinite;
}

.lggf-b1 { width: 10px; height: 10px; left: 15px; bottom: 6px; animation-delay: 0s; }
.lggf-b2 { width: 7px;  height: 7px;  left: 38px; bottom: 4px; animation-delay: 0.5s; }
.lggf-b3 { width: 9px;  height: 9px;  left: 58px; bottom: 8px; animation-delay: 1.0s; }
.lggf-b4 { width: 6px;  height: 6px;  left: 28px; bottom: 3px; animation-delay: 1.4s; }

@keyframes lggf-bubble-up {
    0%   { transform: translateY(0) scale(0.5); opacity: 0; }
    30%  { opacity: 1; }
    100% { transform: translateY(-44px) scale(1); opacity: 0; }
}

/* Steam wisps */
.lggf-steam {
    position: absolute;
    bottom: 54px;
    width: 8px;
    height: 28px;
    background: rgba(200,200,200,0.5);
    border-radius: 50%;
    filter: blur(4px);
    animation: lggf-steam-rise 2s ease-out infinite;
}

.lggf-s1 { left: 22px; animation-delay: 0s; }
.lggf-s2 { left: 42px; animation-delay: 0.7s; }
.lggf-s3 { left: 62px; animation-delay: 1.3s; }

@keyframes lggf-steam-rise {
    0%   { transform: translateY(0) scaleX(1); opacity: 0.7; }
    50%  { transform: translateY(-24px) scaleX(1.6); opacity: 0.4; }
    100% { transform: translateY(-52px) scaleX(2.2); opacity: 0; }
}

/* Lid bounce */
.lggf-lid {
    position: absolute;
    top: -10px;
    left: -4px;
    width: 98px;
    height: 10px;
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    border-radius: 6px 6px 0 0;
    animation: lggf-lid-bounce 1.2s ease-in-out infinite;
    transform-origin: center bottom;
}

.lggf-lid::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 6px;
    background: #6b7280;
    border-radius: 4px 4px 0 0;
}

@keyframes lggf-lid-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    40%      { transform: translateY(-8px) rotate(3deg); }
    60%      { transform: translateY(-6px) rotate(-2deg); }
}

/* Flame */
.lggf-flame-row {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.lggf-flame {
    width: 14px;
    height: 22px;
    background: linear-gradient(0deg, #f59e0b 0%, #ef4444 60%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: lggf-flicker 0.3s ease-in-out infinite alternate;
}

.lggf-flame.lggf-f2 { height: 18px; width: 12px; animation-delay: 0.1s; }
.lggf-flame.lggf-f3 { height: 20px; width: 13px; animation-delay: 0.2s; }

@keyframes lggf-flicker {
    0%   { transform: scaleY(1) scaleX(1); }
    100% { transform: scaleY(0.85) scaleX(1.08); }
}

/* Progress bar */
.lggf-progress-track {
    width: 220px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin: 0 auto 16px;
    overflow: hidden;
}

.lggf-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2d6a4f, #40916c);
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Loading text */
.lggf-loading-text {
    font-size: 17px;
    font-weight: 600;
    color: #2d6a4f;
    margin: 0 0 6px;
    transition: opacity 0.3s;
}

.lggf-loading-subtext {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* Recipe output */
#lggf-recipe-image-wrap {
    margin: -28px -32px 24px;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

#lggf-recipe-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 480px;
    object-fit: cover;
}

/* Recipe card (generated content) */
.lggf-recipe-card .recipe-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.3;
}

.lggf-recipe-card .recipe-description {
    font-size: 16px;
    color: #555;
    margin: 0 0 20px;
    font-style: italic;
}

.lggf-recipe-card .recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 14px 18px;
    background: #f0fdf4;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #bbf7d0;
}

.lggf-recipe-card .meta-item {
    font-size: 14px;
    color: #374151;
    white-space: nowrap;
}

.lggf-recipe-card .meta-item strong {
    color: #2d6a4f;
}

.lggf-recipe-card .recipe-section {
    margin-bottom: 24px;
}

.lggf-recipe-card .recipe-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2d6a4f;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #d1fae5;
}

.lggf-recipe-card .recipe-ingredients {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lggf-recipe-card .recipe-ingredients li {
    padding: 6px 0 6px 24px;
    position: relative;
    font-size: 15px;
    border-bottom: 1px solid #f3f4f6;
}

.lggf-recipe-card .recipe-ingredients li:last-child {
    border-bottom: none;
}

.lggf-recipe-card .recipe-ingredients li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: #2d6a4f;
    font-weight: 700;
}

.lggf-recipe-card .recipe-instructions {
    padding-left: 24px;
    margin: 0;
}

.lggf-recipe-card .recipe-instructions li {
    padding: 8px 0;
    font-size: 15px;
    line-height: 1.7;
    border-bottom: 1px solid #f3f4f6;
}

.lggf-recipe-card .recipe-instructions li:last-child {
    border-bottom: none;
}

.lggf-recipe-card .nutrition-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lggf-recipe-card .nutrition-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
}

.lggf-recipe-card .nutrition-item strong {
    color: #2d6a4f;
}

.lggf-recipe-card .recipe-tips {
    background: #fffbeb;
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid #fde68a;
}

.lggf-recipe-card .recipe-tips h3 {
    border-bottom-color: #fde68a;
    color: #92400e;
}

.lggf-recipe-card .recipe-tips ul {
    margin: 0;
    padding-left: 20px;
}

.lggf-recipe-card .recipe-tips li {
    font-size: 14px;
    color: #78350f;
    margin-bottom: 4px;
}

/* Action buttons row */
.lggf-recipe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Error */
.lggf-error-card {
    background: #fef2f2;
    border-color: #fca5a5;
    text-align: center;
}

.lggf-error-card p {
    color: #991b1b;
    font-weight: 500;
    margin: 0 0 16px;
}

/* Copy success toast */
.lggf-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #2d6a4f;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lggf-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .lggf-card {
        padding: 20px 18px;
    }

    .lggf-form-row {
        flex-direction: column;
        gap: 0;
    }

    .lggf-recipe-card .recipe-title {
        font-size: 22px;
    }

    .lggf-recipe-card .recipe-meta {
        flex-direction: column;
        gap: 4px;
    }

    .lggf-recipe-card .nutrition-grid {
        flex-direction: column;
    }

    .lggf-recipe-actions {
        flex-direction: column;
    }

    .lggf-recipe-actions button {
        width: 100%;
        justify-content: center;
    }

    #lggf-recipe-image-wrap {
        margin: -20px -18px 20px;
    }
}

/* ==========================================================================
   PRINT STYLES — used by the dedicated print window
   ========================================================================== */

@media print {
    /* Hide everything except the recipe output */
    body * {
        visibility: hidden !important;
    }

    #lggf-recipe-output,
    #lggf-recipe-output * {
        visibility: visible !important;
    }

    #lggf-recipe-output {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Hide non-printable UI */
    #lggf-recipe-form,
    .lggf-recipe-actions,
    #lggf-loading,
    #lggf-error,
    .lggf-btn-primary,
    #lggf-pin-btn {
        display: none !important;
    }

    .lggf-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    /* Image: print-safe sizing */
    #lggf-recipe-image-wrap {
        margin: 0 0 16px 0 !important;
        border-radius: 0 !important;
    }

    #lggf-recipe-image {
        max-height: 280px !important;
        width: auto !important;
        max-width: 100% !important;
        display: block !important;
        margin: 0 auto !important;
        border-radius: 8px !important;
    }

    /* Force colors to print */
    .lggf-recipe-card .recipe-title {
        color: #1a1a2e !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .lggf-recipe-card .recipe-meta {
        background: #f0fdf4 !important;
        border: 1px solid #bbf7d0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .lggf-recipe-card .recipe-section h3 {
        color: #2d6a4f !important;
        border-bottom: 2px solid #d1fae5 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .lggf-recipe-card .recipe-tips {
        background: #fffbeb !important;
        border: 1px solid #fde68a !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .lggf-recipe-card .nutrition-item {
        background: #f8fafc !important;
        border: 1px solid #e5e7eb !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Page margins */
    @page {
        margin: 0.6in 0.5in;
        size: letter;
    }

    /* Prevent orphaned sections */
    .lggf-recipe-card .recipe-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Footer credit */
    #lggf-recipe-content::after {
        content: 'Generated by LetsGoGlutenFree.com';
        display: block;
        margin-top: 24px;
        padding-top: 12px;
        border-top: 1px solid #e5e7eb;
        font-size: 11px;
        color: #9ca3af;
        text-align: center;
    }
}
