/* ===================================
   BROCHURE MODAL STYLES
   =================================== */

.brochure-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.brochure-modal.show {
    display: flex !important; /* Show when active */
}

.brochure-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1;
}

.brochure-modal-container {
    position: relative;
    z-index: 2;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brochure-modal-content {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: white;
    width: 100%;
    margin: 20px auto;
    transform: translateY(0);
}

.brochure-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.brochure-modal-close:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: scale(1.1);
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin: 0;
}

/* Form Styles */
.brochure-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: white;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 12px 15px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00a0e6;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(0, 160, 230, 0.2);
}

.form-group input.error,
.form-group select.error {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* Phone Input Group */
.phone-input-group {
    display: flex;
    gap: 10px;
}

.phone-input-group select {
    flex: 0 0 180px;
    font-size: 0.9rem;
}

.phone-input-group input {
    flex: 1;
}

/* Error Messages */
.error-message {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #00a0e6 0%, #0077b3 100%);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    box-shadow: 0 6px 20px rgba(0, 160, 230, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 25px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-link {
    background: none;
    border: none;
    color: #00a0e6;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.btn-link:hover {
    color: #e74c3c;
}

/* OTP Input Styles */
.otp-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.otp-digit {
    width: 50px !important;
    height: 50px !important;
    text-align: center;
    font-size: 1.5rem !important;
    font-weight: 700;
    border-radius: 10px !important;
    padding: 0 !important;
}

.otp-resend {
    text-align: center;
    margin-top: 20px;
}

.otp-resend p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Loading States */
.loading-spinner {
    font-size: 3rem;
    color: #00a0e6;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Icons */
.success-icon {
    font-size: 4rem;
    color: #27ae60;
    margin-bottom: 20px;
}

.error-icon {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 20px;
}

/* Error Actions */
.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Loading Button States */
.btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.btn-loading i {
    animation: spin 1s linear infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .brochure-modal-container {
        width: 95%;
    }
    
    .brochure-modal-content {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 1.5rem;
    }
    
    .phone-input-group {
        flex-direction: column;
    }
    
    .phone-input-group select {
        flex: none;
    }
    
    .otp-digit {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
    }
    
    .otp-input-group {
        gap: 8px;
    }
    
    .error-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .brochure-modal-content {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    .btn-primary {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
    
    .otp-digit {
        width: 35px !important;
        height: 35px !important;
        font-size: 1.1rem !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .brochure-modal-close,
    .btn-primary,
    .btn-secondary,
    .form-group input,
    .form-group select {
        transition: none;
    }
    
    .loading-spinner,
    .btn-loading i {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .brochure-modal-content {
        background: #000;
        border: 2px solid #fff;
    }
    
    .form-group input,
    .form-group select {
        background: #000;
        border-color: #fff;
        color: #fff;
    }
    
    .btn-primary {
        background: #fff;
        color: #000;
    }
}
/* 
Additional centering fixes */
.brochure-modal {
    padding: 20px;
    box-sizing: border-box;
}

.brochure-modal-container {
    min-height: min-content;
}

/* Ensure modal is centered even on small screens */
@media (max-height: 700px) {
    .brochure-modal {
        align-items: flex-start !important;
        padding-top: 40px;
    }
    
    .brochure-modal-container {
        margin-top: 0;
    }
}

/* Perfect centering for all screen sizes */
@media (min-height: 701px) {
    .brochure-modal {
        align-items: center !important;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    height: 100vh;
}
