/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Modal Container */
.modal {
    background: #050f15;
    border: 1px solid #bb8773;
    border-radius: 20px;
    max-width: 450px;
    width: 100%;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
    margin-top: 100px;

    max-height: calc(100vh - 40px); /* 100vh minus margin-top and some breathing room */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(187, 135, 115, 0.1);
    border: 1px solid #bb8773;
    border-radius: 50%;
    color: #bb8773;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(187, 135, 115, 0.2);
}

/* Modal Header */
.modal-header {
    margin-bottom: 24px;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #c58c77;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 14px;
    color: #bb8773;
    opacity: 0.8;
}

/* Course Description */
.modal-course-description {
    background: rgba(187, 135, 115, 0.05);
    border: 1px solid rgba(187, 135, 115, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
    color: #bb8773;
}

/* Duration Toggle */
.duration-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    background: rgba(187, 135, 115, 0.05);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(187, 135, 115, 0.2);
}

.toggle-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #bb8773;
    cursor: pointer;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Syne', sans-serif;
}

.toggle-btn.active {
    background: #bb8773;
    color: #050f15;
}

.toggle-btn:hover {
    background: rgba(187, 135, 115, 0.15);
}

.toggle-btn.active:hover {
    background: #bb8773;
}

/* Pricing Section */
.pricing-section {
    margin-bottom: 24px;
}

.pricing-title {
    font-size: 12px;
    font-weight: 600;
    color: #bb8773;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.pricing-display {
    background: rgba(187, 135, 115, 0.05);
    border: 1px solid rgba(187, 135, 115, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.price-original {
    font-size: 14px;
    color: #bb8773;
    text-decoration: line-through;
    opacity: 0.6;
    margin-bottom: 8px;
}

.price-current {
    font-size: 36px;
    font-weight: 600;
    color: #c58c77;
    margin-bottom: 4px;
}

.price-period {
    font-size: 12px;
    color: #bb8773;
    opacity: 0.7;
}

/* Payment Methods */
.payment-section {
    margin-bottom: 24px;
}

.payment-methods {
    display: flex;
    gap: 12px;
}

.payment-method {
    flex: 1;
    padding: 16px;
    border: 1px solid rgba(187, 135, 115, 0.2);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.payment-method:hover {
    border-color: #bb8773;
    background: rgba(187, 135, 115, 0.05);
}

.payment-method.selected {
    border-color: #bb8773;
    background: rgba(187, 135, 115, 0.15);
}

.payment-icon {
    font-size: 24px;
    color: #bb8773;
}

.payment-name {
    font-size: 12px;
    font-weight: 500;
    color: #bb8773;
}

/* Action Buttons */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: #bb8773;
    color: #050f15;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Syne', sans-serif;
}

.btn-primary:hover {
    background: #c58c77;
    transform: translateY(-2px);
}

.btn-secondary {
    width: 100%;
    padding: 16px;
    background: transparent;
    color: #bb8773;
    border: 1px solid #bb8773;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Syne', sans-serif;
}

.btn-secondary:hover {
    background: rgba(187, 135, 115, 0.1);
}

/* Responsive */
@media (max-width: 576px) {
    .modal {
        max-width: 100%;
        padding: 24px;
        padding-bottom: 60px;
    }

    .modal-title {
        font-size: 20px;
    }

    .price-current {
        font-size: 32px;
    }
}