/**
 * Teaser Download Modal Styles
 *
 * Modal popup for lead capture on report pages
 *
 * @package Dagora_Theme
 */

/* ==========================================================================
   Modal Container & Overlay
   ========================================================================== */

.teaser-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.teaser-modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.teaser-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* ==========================================================================
   Modal Container
   ========================================================================== */

.teaser-modal__container {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-light-3);
    border-radius: var(--radius-md);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.teaser-modal[aria-hidden="false"] .teaser-modal__container {
    transform: translateY(0);
}

/* Close Button */
.teaser-modal__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-gray);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.teaser-modal__close:hover {
    background: var(--color-light-2);
    color: var(--color-dark);
}

.teaser-modal__close ion-icon {
    font-size: 24px;
}

/* ==========================================================================
   Modal Header
   ========================================================================== */

.teaser-modal__header {
    padding: var(--space-2xl) var(--space-2xl) var(--space-lg);
    border-bottom: 1px solid var(--color-light);
}

#teaser-modal-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-dark);
    margin: 0 0 var(--space-sm) 0;
}

.teaser-modal__subtitle {
    font-size: var(--text-base);
    color: var(--color-gray);
    margin: 0;
    line-height: 1.5;
}

.teaser-modal__subtitle strong {
    color: var(--color-dark);
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.teaser-modal__form {
    padding: var(--space-xl) var(--space-2xl) var(--space-2xl);
}

.teaser-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.teaser-form__field {
    margin-bottom: var(--space-lg);
}

.teaser-form__field label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-dark);
    margin-bottom: var(--space-xs);
}

.teaser-form__field .required {
    color: var(--color-error);
}

.teaser-form__field input {
    width: 100%;
    padding: var(--space-md);
    font-size: var(--text-base);
    border: 2px solid var(--color-light);
    border-radius: var(--radius-sm);
    background: white;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.teaser-form__field input:focus {
    outline: none;
    border-color: var(--color-brutalist-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.teaser-form__field input::placeholder {
    color: var(--color-gray-2);
}

/* ==========================================================================
   Messages
   ========================================================================== */

.teaser-form__messages {
    margin-bottom: var(--space-lg);
}

.teaser-form__error,
.teaser-form__success {
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.teaser-form__error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.teaser-form__success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.teaser-form__actions {
    margin-bottom: var(--space-lg);
}

.teaser-form__submit {
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: white;
    background: var(--color-brutalist-purple);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.teaser-form__submit:hover:not(:disabled) {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.teaser-form__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.teaser-form__submit-loading ion-icon {
    margin-right: var(--space-xs);
}

.teaser-form__submit-loading ion-icon.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Privacy Notice
   ========================================================================== */

.teaser-form__privacy {
    font-size: 12px;
    color: var(--color-gray-2);
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

/* ==========================================================================
   Trigger Button (used on report page)
   ========================================================================== */

.teaser-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-light-3);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.teaser-trigger-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.teaser-trigger-btn ion-icon {
    font-size: 18px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
    .teaser-modal {
        padding: var(--space-md);
    }

    .teaser-modal__container {
        max-height: 95vh;
    }

    .teaser-modal__header {
        padding: var(--space-xl) var(--space-lg) var(--space-md);
    }

    .teaser-modal__form {
        padding: var(--space-lg);
    }

    .teaser-form__row {
        grid-template-columns: 1fr;
    }

    #teaser-modal-title {
        font-size: var(--text-xl);
    }
}
