/* Modal Styles for Book Landing Pages - Christmas Theme */
/* This file contains reusable modal styles for all book download forms */

/* Modal Styles - Christmas Theme */
.book-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
    overflow-y: auto;
    padding: 50px;
    box-sizing: border-box;
}

.book-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    max-width: 520px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: slideIn 0.4s ease;
    border: 2px solid rgba(196, 30, 58, 0.1);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #c41e3a 0%, #e74c3c 100%);
    color: white;
    border-radius: 24px 24px 0 0;
    position: relative;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: bold;
    font-family: 'Nunito', sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    padding: 20px;
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-family: Arial, sans-serif;
    font-weight: bold;
    line-height: 1;
}

.close-btn::before {
    display: block;
    margin-top: -2px;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.close-btn:active {
    transform: scale(0.95);
}

.modal-body {
    padding: 20px !important;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c41e3a #f1f1f1;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c41e3a, #e74c3c);
    border-radius: 3px;
}

.modal-subtitle {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 30px;
    text-align: center;
    font-family: 'Nunito', sans-serif;
    line-height: 1.5;
}

.book-form .form-group {
    margin-bottom: 18px !important;
}

.book-form label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-family: 'Nunito', sans-serif;
}

.book-form input,
.book-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    font-family: 'Nunito', sans-serif;
    box-sizing: border-box;
}

/* Birth year dropdown - force native select styling */
.book-form #birth_year {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: pointer;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: auto !important;
}

/* Hide any nice-select wrappers for birth_year */
.book-form #birth_year + .nice-select,
.book-form .nice-select[data-id="birth_year"] {
    display: none !important;
}

.book-form input:focus,
.book-form select:focus {
    outline: none;
    border-color: #c41e3a;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 18px;
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.help-text {
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

/* Custom checkbox styling */
.checkbox-group {
    margin-bottom: 18px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.4;
    margin-bottom: 0;
    font-size: 0.9rem;
    font-family: 'Nunito', sans-serif;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #c41e3a;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s ease;
    background: white;
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #c41e3a;
    border-color: #c41e3a;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    display: block;
}

.checkbox-text {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
}

.checkbox-text a {
    color: #c41e3a;
    text-decoration: underline;
}

.checkbox-text a:hover {
    color: #a01729;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #c41e3a 0%, #e74c3c 100%);
    color: white;
    padding: 18px 30px;
    border: none;
    border-radius: 16px;
    font-size: 1.15rem;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    box-shadow: 
        0 8px 20px rgba(196, 30, 58, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 15px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.privacy-note {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

/* Success state */
.modal-content.success {
    text-align: center;
    padding: 50px 30px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.modal-content.success h3 {
    color: #27ae60;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.modal-content.success p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 10px;
}

.btn-close {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s ease;
}

.btn-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .modal-header h3 {
        font-size: 1.3rem;
    }
}