/* Modal Styles */
.terms-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 2% auto;
    padding: 40px 30px;
    width: 85%;
    max-width: 900px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 85vh;
    overflow-y: auto;
    border-top: 6px solid #7d3bed;
}

.terms-modal-header {
    position: sticky;
    top: 0;
    background-color: #fff;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #EBF5FF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.close-modal {
    position: fixed;
    top: 20px;
    right: calc(7.5% + 20px); /* Adjusted to account for modal content position */
    color: white;
    background-color: #7d3bed;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
}

.close-modal:hover {
    background-color: #6429c8;
    transform: scale(1.05);
}

.terms-modal h2 {
    color: #7d3bed;
    font-size: 1.8rem;
    margin: 0;
    padding: 10px 0;
}

.terms-modal h3 {
    color: #8d53ef;
    font-size: 1.4rem;
    margin: 30px 0 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #f0ebff;
}

.terms-modal h4 {
    color: #9963f7;
    font-size: 1.2rem;
    margin: 20px 0 10px;
}

.terms-modal p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #333;
}

.terms-modal ul {
    margin-left: 20px;
    margin-bottom: 20px;
    padding-left: 15px;
}

.terms-modal li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #333;
}

.terms-modal-footer {
    margin-top: 40px;
    padding-top: 15px;
    border-top: 2px solid #EBF5FF;
    text-align: center;
}

.terms-modal-close-btn {
    display: inline-block;
    background-color: #7d3bed;
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    margin: 10px 0;
}

.terms-modal-close-btn:hover {
    background-color: #6429c8;
    transform: translateY(-2px);
}

/* Fix scrolling issues on iOS */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto 5%;
        width: 90%;
        padding: 30px 20px;
    }
    
    .close-modal {
        right: calc(5% + 15px);
        top: 15px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .terms-modal h2 {
        font-size: 1.5rem;
    }
    
    .terms-modal h3 {
        font-size: 1.2rem;
    }
    
    .terms-modal h4 {
        font-size: 1.1rem;
    }
}
