/**
 * PDF Download Modal Styles
 */

/* Modal Overlay */
.pdf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.pdf-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.pdf-modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.pdf-modal-overlay.is-active .pdf-modal {
    transform: scale(1);
}

/* Modal Header */
.pdf-modal__header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #E0E0E0;
    position: relative;
}

.pdf-modal__title {
    font-size: 24px;
    font-weight: 700;
    color: #1E66B1;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.pdf-modal__subtitle {
    font-size: 14px;
    color: #666666;
    margin: 0;
    line-height: 1.5;
}

.pdf-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #999999;
    font-size: 24px;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.pdf-modal__close:hover {
    color: #333333;
    transform: rotate(90deg);
}

/* Modal Body */
.pdf-modal__body {
    padding: 30px;
}

/* Form */
.pdf-modal__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pdf-modal__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdf-modal__label {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
}

.pdf-modal__label--required::after {
    content: '*';
    color: #E74C3C;
    margin-left: 4px;
}

.pdf-modal__input {
    padding: 12px 16px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 15px;
    color: #333333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.pdf-modal__input:focus {
    outline: none;
    border-color: #1E66B1;
    box-shadow: 0 0 0 3px rgba(30, 102, 177, 0.1);
}

.pdf-modal__input::placeholder {
    color: #AAAAAA;
}

.pdf-modal__input.is-error {
    border-color: #E74C3C;
}

.pdf-modal__input.is-error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Checkbox */
.pdf-modal__checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pdf-modal__checkbox {
    margin-top: 3px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #1E66B1;
}

.pdf-modal__checkbox-label {
    font-size: 13px;
    color: #666666;
    line-height: 1.5;
    cursor: pointer;
}

.pdf-modal__checkbox-label a {
    color: #1E66B1;
    text-decoration: underline;
}

.pdf-modal__checkbox-label a:hover {
    color: #135E96;
}

/* Error Message */
.pdf-modal__error {
    font-size: 13px;
    color: #E74C3C;
    margin-top: -12px;
    display: none;
}

.pdf-modal__error.is-visible {
    display: block;
}

/* Success Message */
.pdf-modal__success {
    background-color: #D4EDDA;
    border: 1px solid #C3E6CB;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.pdf-modal__success.is-visible {
    display: block;
}

/* Modal Footer */
.pdf-modal__footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 12px;
}

.pdf-modal__button {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pdf-modal__button--primary {
    background-color: #1E66B1;
    color: white;
}

.pdf-modal__button--primary:hover:not(:disabled) {
    background-color: #135E96;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 102, 177, 0.3);
}

.pdf-modal__button--primary:disabled {
    background-color: #CCCCCC;
    cursor: not-allowed;
}

.pdf-modal__button--secondary {
    background-color: #F5F5F5;
    color: #666666;
}

.pdf-modal__button--secondary:hover {
    background-color: #E0E0E0;
}

/* Loading State */
.pdf-modal__button--loading {
    position: relative;
    color: transparent;
}

.pdf-modal__button--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: pdf-modal-spin 0.8s linear infinite;
}

@keyframes pdf-modal-spin {
    to { transform: rotate(360deg); }
}

/* Promo Card Clickable State */
.promo-card--pdf-enabled {
    cursor: pointer;
    position: relative;
}

.promo-card--pdf-enabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(30, 102, 177, 0.9) 0%,
        rgba(30, 102, 177, 0.7) 40%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.promo-card--pdf-enabled:hover::before {
    opacity: 1;
}

.promo-card--pdf-enabled::after {
    content: 'Download Itinerary';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    color: #1E66B1;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
}

.promo-card--pdf-enabled:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 600px) {
    .pdf-modal {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    .pdf-modal__header {
        padding: 20px 20px 15px;
    }

    .pdf-modal__title {
        font-size: 20px;
    }

    .pdf-modal__body {
        padding: 20px;
    }

    .pdf-modal__footer {
        padding: 15px 20px 20px;
        flex-direction: column;
    }

    .pdf-modal__button {
        width: 100%;
    }
}
