/* PF 2025 Modal Styles */

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-overlay.hidden {
    display: none;
}

/* Modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #8B0000;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Modal content */
.modal-content {
    padding-top: 0;
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 0;
    flex: 1;
    overflow-y: auto;
}

/* Modal container */
.modal {
    background: white;
    border-radius: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay.visible .modal {
    transform: scale(1);
    opacity: 1;
}

/* Illustration block */
.illustration-block {
    text-align: center;
    margin-bottom: 2rem;
}

.illustration-block img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: solid 1px rgba(100, 100, 100, 0.2);
}

/* Textarea block */
.textarea-block {
    margin-bottom: 1.5rem;
}

.textarea-block textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    height: 156px;
    transition: border-color 0.2s ease;
}

.textarea-block textarea:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

/* Wish option */
.wish-option {
    margin-bottom: 1.5rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.checkbox-wrapper input[type="checkbox"] {
    margin-right: 0.75rem;
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    accent-color: #8B0000;
    flex-shrink: 0;
}

.checkbox-wrapper label {
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.label-primary {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.label-secondary {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.3;
    font-weight: normal;
}

/* Modal footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #fafafa;
    border-top: 1px solid #e5e5e5;
    border-radius: 0;
    margin-top: auto;
}

.modal-footer .dismiss-link {
    color: #b02717;
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-footer .dismiss-link:hover {
    color: #8B0000;
    text-decoration: underline;
}

.modal-footer button {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #8B0000;
    color: white;
    min-width: 160px;
}

.modal-footer button:disabled {
    background-color: #ccc;
    color: #999;
    cursor: not-allowed;
}

.modal-footer button:not(:disabled):hover {
    background-color: #660000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
}

.modal-footer button:not(:disabled):active {
    transform: translateY(0);
}

/* Success/Info messages */
.message {
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    display: none;
}

.message.visible {
    display: block;
}

.message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.message.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Hidden canvas for PF generation */
#pfCanvas {
    display: none;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .modal {
        margin: 0.5rem;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .button-row {
        flex-direction: column;
        align-items: center;
    }

    .button-row button {
        width: 100%;
        max-width: 300px;
        margin-bottom: 0.5rem;
    }
}
