/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: #adb5bd #f8f9fa; /* For Firefox */
}

/* Custom scrollbar for Webkit browsers */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border-radius: 4px;
    border: 2px solid #f8f9fa;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.split-options {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.split-options p {
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 500;
    color: #495057;
}

.split-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.split-option-btn {
    padding: 8px 12px;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #495057;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.split-option-btn:hover {
    background-color: #dee2e6;
    border-color: #adb5bd;
}

.split-option-btn:active {
    background-color: #ced4da;
    transform: translateY(1px);
}

.custom-split-btn {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #1976d2;
}

.custom-split-btn:hover {
    background-color: #bbdefb;
    border-color: #64b5f6;
}

.custom-split-container {
    margin-top: 12px;
    padding: 10px;
    background-color: #e3f2fd;
    border-radius: 6px;
    border: 1px solid #90caf9;
}

.custom-split-input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.split-count-input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.split-count-input:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}


.custom-split-preview {
    font-size: 0.9rem;
    color: #1976d2;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Responsive styles for mobile */
@media (max-width: 480px) {
    .modal {
        padding: 10px;
        align-items: flex-start;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 85vh;
        margin-top: 20px;
    }
    
    .split-buttons {
        flex-direction: column;
    }
    
    .split-option-btn {
        width: 100%;
        padding: 10px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions button {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .custom-split-input {
        flex-wrap: wrap;
    }
    
    .split-count-input {
        flex-grow: 1;
        padding: 10px;
        font-size: 16px; /* Larger font size for better touch targets */
    }
}
