/**
 * Gotuj Checklist Styles
 *
 * Styles for the interactive ingredient checklist
 */

/* Checklist Wrapper */
.gotuj-checklist-wrapper {
    background: #fafafa;
    border: none;
    border-radius: 4px;
    padding: 25px 30px;
    margin: 25px 0;
    position: relative;
}

.gotuj-checklist-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    color: #333;
    flex: 1;
    min-width: 0;
}

.gotuj-checklist-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.gotuj-checklist-header-row--icon-only {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    justify-content: flex-end;
}

/* Info Icon */
.gotuj-info-button {
    position: relative;
    width: 22px;
    height: 22px;
    border: 1px solid #bbb;
    border-radius: 50%;
    background: #fff;
    color: #666;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.gotuj-info-button:hover,
.gotuj-info-button:focus {
    border-color: #333;
    color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
    outline: none;
}

.gotuj-info-icon {
    font-family: 'Lora', Georgia, serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-transform: lowercase;
}

.gotuj-info-tooltip {
    position: absolute;
    top: 30px;
    right: 0;
    background: #333;
    color: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    pointer-events: none;
}

.gotuj-info-tooltip::after {
    content: '';
    position: absolute;
    top: -6px;
    right: 8px;
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
}

.gotuj-info-button:hover .gotuj-info-tooltip,
.gotuj-info-button:focus .gotuj-info-tooltip,
.gotuj-info-button.is-open .gotuj-info-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Checklist */
.gotuj-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gotuj-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
    margin: 0;
}

.gotuj-checklist-item:last-child {
    border-bottom: none;
}

.gotuj-checklist-item:hover {
    background: #f5f5f5;
    margin-left: -15px;
    margin-right: -15px;
    padding-left: 15px;
    padding-right: 15px;
}

/* Checkbox */
.gotuj-checkbox {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: all 0.2s ease;
    background: #fff;
    box-shadow: none;
    outline: none;
}

.gotuj-checklist-item.checked .gotuj-checkbox {
    background: #333;
    border-color: #333;
}

.gotuj-checklist-item.checked .gotuj-checkbox::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

/* Item Text */
.gotuj-item-text {
    flex: 1;
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.gotuj-checklist-item.checked .gotuj-item-text {
    text-decoration: line-through;
    color: #999;
}

/* Header/Label Items (lines ending with colon) */
.gotuj-checklist-header {
    display: block;
    padding: 20px 0 12px 0;
    margin: 0;
    border-bottom: 1px solid #eee;
}

.gotuj-checklist-header:first-child {
    padding-top: 5px;
}

.gotuj-header-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #333;
}

/* Clear Button */
.gotuj-clear-btn {
    display: inline-flex;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ccc;
    cursor: default;
    transition: all 0.3s ease;
    align-items: center;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.5;
}

.gotuj-clear-btn:hover {
    background: transparent;
    border-color: #ddd;
    color: #ccc;
}

.gotuj-clear-btn.visible {
    color: #666;
    cursor: pointer;
    pointer-events: auto;
    opacity: 1;
}

.gotuj-clear-btn.visible:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* Accessibility */
.gotuj-checklist-item:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .gotuj-checklist-wrapper {
        border: 1px solid #000;
        box-shadow: none;
    }

    .gotuj-checklist-item.checked .gotuj-item-text {
        text-decoration: none;
        color: inherit;
    }

    .gotuj-checkbox::after {
        content: '☐';
        font-size: 16px;
    }

    .gotuj-checklist-item.checked .gotuj-checkbox::after {
        content: '☑';
        color: #000;
    }

    .gotuj-clear-btn {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .gotuj-checklist-wrapper {
        padding: 20px;
    }

    .gotuj-checklist-item {
        gap: 12px;
    }

    .gotuj-checkbox {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }

    .gotuj-item-text {
        font-size: 0.95rem;
    }

    .gotuj-info-tooltip {
        white-space: normal;
        max-width: 220px;
    }
}

/* Share Button */
.gotuj-share-btn {
    display: none;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.gotuj-share-btn:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

.gotuj-share-btn svg {
    width: 14px;
    height: 14px;
}

.gotuj-share-btn.visible {
    display: inline-flex;
}

/* Copy Button */
.gotuj-copy-btn {
    display: none;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.gotuj-copy-btn:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

.gotuj-copy-btn svg {
    width: 14px;
    height: 14px;
}

.gotuj-copy-btn.visible {
    display: inline-flex;
}

.gotuj-copy-btn.copied {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.gotuj-copy-btn.error {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.gotuj-checklist-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    align-items: center;
}

/* Wspólne style dla przycisków w akcjach */
.gotuj-checklist-actions button {
    box-sizing: border-box;
    flex-shrink: 0;
    height: auto;
    line-height: 1.2;
}

/* Usuń focus/active state na mobile - ramka po kliknięciu */
.gotuj-checklist-item:focus,
.gotuj-checklist-item:active {
    outline: none;
    background: transparent;
}

@media (hover: none) {
    .gotuj-checklist-item:hover {
        background: transparent;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }
    
    .gotuj-checklist-item:focus {
        outline: none;
    }
}

/* Mobile adjustments for buttons */
@media (max-width: 480px) {
    .gotuj-checklist-actions {
        flex-direction: column;
    }
    
    .gotuj-copy-btn,
    .gotuj-share-btn,
    .gotuj-clear-btn {
        width: 100%;
        justify-content: center;
    }
}
