<script lang="ts">
    export let content: string;
    export let onClose: () => void;
</script>

<div class="overlay">
    <div class="popup">
        <div class="popup-header">
            <h3>Information Popup</h3>
            <button class="close-button" on:click={onClose}>
                <span class="material-icons">close</span>
            </button>
        </div>
        <div class="popup-content">
            {@html content}
        </div>
    </div>
</div>

<style>
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }

    .popup {
        background-color: var(--bg-primary);
        border-radius: 0.75rem;
        padding: 1.5rem;
        max-width: 30rem;
        width: 90%;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        position: relative;
    }

    .popup-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }

    .popup-header h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .close-button {
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.25rem;
        margin-left: 1rem;
        color: #ff5555;
        transition: color 0.2s;
    }

    .close-button:hover {
        color: #ff0000;
    }

    .close-button .material-icons {
        font-size: 1.5rem;
    }

    .popup-content {
        color: var(--text-primary);
        line-height: 1.5;
        font-size: 0.9375rem;
    }

    .popup-content :global(p) {
        margin: 0 0 1rem 0;
    }

    .popup-content :global(p:last-child) {
        margin-bottom: 0;
    }
</style>